Commit db14dbfe authored by terrymanu's avatar terrymanu
Browse files

fix multiple thread read connection throw npe

parent 124ac0b7
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -23,7 +23,7 @@ import io.shardingsphere.proxy.config.RuleRegistry;
import java.sql.Connection;
import java.sql.SQLException;
import java.util.Collection;
import java.util.LinkedList;
import java.util.concurrent.CopyOnWriteArrayList;

/**
 * Backend connection.
@@ -33,7 +33,7 @@ import java.util.LinkedList;
 */
public final class BackendConnection implements AutoCloseable {
    
    private final Collection<Connection> cachedConnections = new LinkedList<>();
    private final Collection<Connection> cachedConnections = new CopyOnWriteArrayList<>();
    
    /**
     * Get connection of current thread datasource.