/** * INTERNAL: * Set the connection to be used for database modification. */ public void setWriteConnections(Map<String, Accessor> writeConnections) { // Clear customizers. if ((this.writeConnections != null) && (writeConnections == null)) { for (Accessor accessor : this.writeConnections.values()) { accessor.releaseCustomizer(this); } } this.writeConnections = writeConnections; }
/** * INTERNAL: * Set the connection to be used for database modification. */ public void setWriteConnections(Map<String, Accessor> writeConnections) { // Clear customizers. if ((this.writeConnections != null) && (writeConnections == null)) { for (Accessor accessor : this.writeConnections.values()) { accessor.releaseCustomizer(this); } } this.writeConnections = writeConnections; }
/** * INTERNAL: * When you release an external connection, you simply let it go. */ public void releaseConnection(Accessor connection) throws DatabaseException { connection.closeConnection(); connection.releaseCustomizer(); }
/** * 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: * When you release an external connection, you simply let it go. */ public void releaseConnection(Accessor connection) throws DatabaseException { if (this.owner.shouldLog(SessionLog.FINEST, SessionLog.CONNECTION)) { Object[] args = new Object[1]; args[0] = this.name; this.owner.log(SessionLog.FINEST, SessionLog.CONNECTION, "release_connection", args, connection); } if (!this.failoverConnectionPools.isEmpty()) { if (!connection.isValid()) { if (this.checkConnections) { // If 2nd dead connection, then assume dead. this.isDead = true; } else { this.checkConnections = true; } } else { this.checkConnections = false; } } connection.closeConnection(); connection.releaseCustomizer(); }
/** * INTERNAL: * When you release an external connection, you simply let it go. */ public void releaseConnection(Accessor connection) throws DatabaseException { if (this.owner.shouldLog(SessionLog.FINEST, SessionLog.CONNECTION)) { Object[] args = new Object[1]; args[0] = this.name; this.owner.log(SessionLog.FINEST, SessionLog.CONNECTION, "release_connection", args, connection); } if (!this.failoverConnectionPools.isEmpty()) { if (!connection.isValid()) { if (this.checkConnections) { // If 2nd dead connection, then assume dead. this.isDead = true; } else { this.checkConnections = true; } } else { this.checkConnections = false; } } connection.closeConnection(); connection.releaseCustomizer(); }
connection.releaseCustomizer();