public class DBConnectionPool extends Shutdown implements DBBackend
| Modifier and Type | Class and Description |
|---|---|
class |
DBConnectionPool.CheckConnection
DOCUMENT ME!
|
| Modifier and Type | Field and Description |
|---|---|
int |
retriesOnError |
PRIORITY_EARLIER, PRIORITY_EARLIEST, PRIORITY_LATER, PRIORITY_LATEST, PRIORITY_NORMAL| Constructor and Description |
|---|
DBConnectionPool(DBClassifier dbc)
Creates a new DBConnectionPool object.
|
DBConnectionPool(ServerProperties props)
Creates a new DBConnectionPool object.
|
| Modifier and Type | Method and Description |
|---|---|
void |
closeConnections()
DOCUMENT ME!
|
Connection |
getConnection()
Returns a native JDBC
Connection. |
Connection |
getConnection(boolean longTerm)
Deprecated.
Use either getConnection() or getLongTermConnection()
|
DBConnection |
getDBConnection()
Deprecated.
this operation is marked as deprecated as it is discouraged to use a
DBConnection directly.
Use a DBBackend instead. This method is subject to be refactored to private access. |
DBConnection |
getDBConnection(boolean longTerm)
Deprecated.
this operation is marked as deprecated as it is discouraged to use a
DBConnection directly.
Use a DBBackend instead. This method is subject to be refactored to private access. |
DBConnection |
getDBConnection(boolean longTerm,
boolean cleanup)
Deprecated.
this operation is marked as deprecated as it is discouraged to use a
DBConnection directly.
Use a DBBackend instead. This method is subject to be refactored to private access. |
Connection |
getLongTermConnection()
DOCUMENT ME!
|
int |
getRetriesOnError()
Gets the current number of retries.
|
static boolean |
isDbErrorTransient(SQLException se)
Attempt to figure out whether a given database error could be transient and might be worth a retry.
|
void |
releaseDbConnection(Connection connection)
DOCUMENT ME!
|
void |
setRetriesOnError(int noOfRetries)
Sets the number of retries the backend shall perform in case of an error during execution.
|
ResultSet |
submitInternalQuery(String descriptor,
Object... parameters)
This operation shall be used to execute queries that related to the tables of the underlying cids system (cs_*).
|
int |
submitInternalUpdate(String descriptor,
Object... parameters)
This operation shall be used to execute updates that related to the tables of the underlying cids system (cs_*).
|
ResultSet |
submitQuery(int sqlID,
Object... parameters)
DOCUMENT ME!
This operation shall throw a SQLException if the Shutdownable.shutdown() has already been
called. |
ResultSet |
submitQuery(String descriptor,
Object... parameters)
DOCUMENT ME!
This operation shall throw a SQLException if the Shutdownable.shutdown() has already been
called. |
int |
submitUpdate(int sqlID,
Object... parameters)
DOCUMENT ME!
This operation shall throw a SQLException if the Shutdownable.shutdown() has already been
called. |
int |
submitUpdate(String descriptor,
Object... parameters)
DOCUMENT ME!
This operation shall throw a SQLException if the Shutdownable.shutdown() has already been
called. |
addShutdown, addShutdown, createShutdown, internalShutdown, removeShutdownisDown, shutdownclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitisDown, shutdownpublic DBConnectionPool(DBClassifier dbc)
dbc - DOCUMENT ME!ServerExitError - DOCUMENT ME!public DBConnectionPool(ServerProperties props)
props - DOCUMENT ME!@Deprecated public DBConnection getDBConnection()
DBConnection directly.
Use a DBBackend instead. This method is subject to be refactored to private access.@Deprecated public DBConnection getDBConnection(boolean longTerm)
DBConnection directly.
Use a DBBackend instead. This method is subject to be refactored to private access.longTerm - DOCUMENT ME!@Deprecated public DBConnection getDBConnection(boolean longTerm, boolean cleanup)
DBConnection directly.
Use a DBBackend instead. This method is subject to be refactored to private access.longTerm - DOCUMENT ME!cleanup - DOCUMENT ME!public void releaseDbConnection(Connection connection)
connection - DOCUMENT ME!public void closeConnections()
public void setRetriesOnError(int noOfRetries)
DBBackend0. The retry shall only take place if the underlying error indicates that
the retry could be senseful (e.g. connection drop, db restart ...).setRetriesOnError in interface DBBackendnoOfRetries - the number of retries that shall be performed in case of an error during executionDBBackend.getRetriesOnError()public int getRetriesOnError()
DBBackend0 or a negative int means that the operation will
be performed exactly once, 1 means that the operation will be executed up to two times,
2 up to three times and so on. The retry shall only take place if the underlying error indicates that
the retry could be senseful (e.g. connection drop, db restart ...).getRetriesOnError in interface DBBackendpublic Connection getConnection(boolean longTerm) throws SQLException
longTerm - true, iff a long term connectionn should be returned. Caution: Long term connections must
be released after use.SQLException - DOCUMENT ME!public Connection getLongTermConnection() throws SQLException
SQLException - DOCUMENT ME!public Connection getConnection() throws SQLException
DBBackendConnection.getConnection in interface DBBackendConnectionSQLException - if any error occurs while acquiring the Connectionpublic ResultSet submitInternalQuery(String descriptor, Object... parameters) throws SQLException
DBBackendSQLException.SQLException is thrown.SQLException if the Shutdownable.shutdown() has already been
called.submitInternalQuery in interface DBBackenddescriptor - one of the descriptors defined in this interfaceparameters - the parameters the underlying query will takeResultSet of the executed querySQLException - public int submitInternalUpdate(String descriptor, Object... parameters) throws SQLException
DBBackendSQLException.SQLException is thrown.SQLException if the Shutdownable.shutdown() has already been
called.submitInternalUpdate in interface DBBackenddescriptor - one of the descriptors defined in this interfaceparameters - the parameters the underlying query will takeSQLException - public ResultSet submitQuery(String descriptor, Object... parameters) throws SQLException
DBBackendSQLException if the Shutdownable.shutdown() has already been
called.submitQuery in interface DBBackenddescriptor - DOCUMENT ME!parameters - DOCUMENT ME!SQLException - DOCUMENT ME!public ResultSet submitQuery(int sqlID, Object... parameters) throws SQLException
DBBackendSQLException if the Shutdownable.shutdown() has already been
called.submitQuery in interface DBBackendsqlID - DOCUMENT ME!parameters - DOCUMENT ME!SQLException - DOCUMENT ME!public int submitUpdate(String descriptor, Object... parameters) throws SQLException
DBBackendSQLException if the Shutdownable.shutdown() has already been
called.submitUpdate in interface DBBackenddescriptor - DOCUMENT ME!parameters - DOCUMENT ME!SQLException - DOCUMENT ME!public int submitUpdate(int sqlID,
Object... parameters)
throws SQLException
DBBackendSQLException if the Shutdownable.shutdown() has already been
called.submitUpdate in interface DBBackendsqlID - DOCUMENT ME!parameters - DOCUMENT ME!SQLException - DOCUMENT ME!public static boolean isDbErrorTransient(SQLException se)
se - Exception thrown by persistence providerCopyright © 2012–2026 cismet GmbH. All rights reserved.