/** * INTERNAL: * Set the connection to be used for database modification. */ public void setWriteConnection(Accessor writeConnection) { if(writeConnection != null) { // new writeConnection is set this.writeConnection = writeConnection; this.writeConnection.createCustomizer(this); } else { // existing writeConnection is released; the not null check in case the method called twice. if(this.writeConnection != null) { this.writeConnection.releaseCustomizer(this); this.writeConnection = null; } } }
/** * INTERNAL: * Add the connection to the client session. * Multiple connections are supported to allow data partitioning and replication. * The accessor is returned, as if detected to be dead it may be replaced. */ public Accessor addWriteConnection(String poolName, Accessor writeConnection) { getWriteConnections().put(poolName, writeConnection); writeConnection.createCustomizer(this); //if connection is using external connection pooling then the event will be risen right after it connects. if (!writeConnection.usesExternalConnectionPooling()) { postAcquireConnection(writeConnection); } // Transactions are lazily started on connections. if (isInTransaction()) { basicBeginTransaction(writeConnection); } return getWriteConnections().get(poolName); }
/** * INTERNAL: * Add the connection to the client session. * Multiple connections are supported to allow data partitioning and replication. * The accessor is returned, as if detected to be dead it may be replaced. */ public Accessor addWriteConnection(String poolName, Accessor writeConnection) { getWriteConnections().put(poolName, writeConnection); writeConnection.createCustomizer(this); //if connection is using external connection pooling then the event will be risen right after it connects. if (!writeConnection.usesExternalConnectionPooling()) { postAcquireConnection(writeConnection); } // Transactions are lazily started on connections. if (isInTransaction()) { basicBeginTransaction(writeConnection); } return getWriteConnections().get(poolName); }
writeConnection.createCustomizer(this);
writeConnection.createCustomizer(this);