Creates a new AbstractConnectionManager instance: assigns
login/password and instanciates transaction id/connection mapping.
Parameters: backendUrl - URL of the DatabaseBackend owning thisconnection manager Parameters: backendName - name of the DatabaseBackend owning thisconnection manager Parameters: rLogin - backend connection login to be used by this connectionmanager Parameters: rPassword - backend connection password to be used by this connectionmanager Parameters: driverPath - path for driver Parameters: driverClassName - class name for driver
Creates a new connection manager with the same parameters but a different
backend user and password.
Parameters: rLogin - real login Parameters: rPassword - real password an AbstractConnectionManager for the new user
Copy this connection manager and replace the name of the backend and its
url Every other parameter is the same
Parameters: url - the url to the backend associated to this ConnectionManager Parameters: name - the name of the backend AbstractConnectionManager throws: Exception - if clone fails
public void deletePersistentConnection(long persistentConnectionId)(Code)
Deletes a connection associated to the persistentConnectionId.
Do nothing if there is no connection associated to the
persistentConnectionId
Parameters: persistentConnectionId - the id of the persistent connection to delete
Gets a connection from the pool (implementation specific).
a Connection or null if no connectionis available or if the connection has not been initialized. throws: UnreachableBackendException - if the backend must be disabled
Gets a new connection for a transaction. This function calls
AbstractConnectionManager.getConnection() to get the connection and store the mapping
between the connection and the transaction id.
Note that this function does not start the transaction, it is up to the
caller to call setAutoCommit(false) on the returned connection.
Parameters: transactionId - the transaction id. a Connection or null if no connectionis available . throws: UnreachableBackendException - if the backend must be disabled See Also:AbstractConnectionManager.getConnection()
Initializes the connection(s) to the database. The caller must ensure that
the driver has already been loaded else an exception will be thrown.
exception: SQLException - if an error occurs.
public void registerConnectionForTransaction(PooledConnection c, long transactionId)(Code)
Enlist a connection for a transaction (maintains the transaction id <->
connection mapping).
Parameters: c - a pooled connection Parameters: transactionId - the transaction id to register this connection for
Gets a connection from the pool in autocommit mode. If a persistent id is
defined for the request, the appropriate connection is retrieved.
Parameters: request - the request asking for a connection (we will check itspersistent connection id) a PooledConnection or null if noconnection is available or if the connection has not beeninitialized. throws: UnreachableBackendException - if the backend must be disabled
setConnectionTestStatement
public void setConnectionTestStatement(String connectionTestStatement)(Code)
Set the SQL string used to test whether or not the server is available.
Parameters: connectionTestStatement - connection test statement to use for thispool
Mark the ConnectionManager as shutdown. getConnection() should return null
from now on and any threads waiting in getConnection() should wake up. This
is used when a database is shutting down due to an error. It is not needed
in the case of a clean shutdown, because everybody will stop requesting
connections at the correct time.