|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.opensubsystems.core.persist.db.DatabaseConnectionFactoryImpl
org.opensubsystems.core.persist.db.connectionpool.PooledDatabaseConnectionFactoryImpl
org.opensubsystems.core.persist.db.connectionpool.ProxoolDatabaseConnectionFactoryImpl
public class ProxoolDatabaseConnectionFactoryImpl
Implementation of connection pool using Objectweb Proxool package (http://proxool.sourceforge.net/). Design of Proxool doesn't allow us to use separate instance of Proxool for each database connection factory. This is because ConnectionPoolManager singleton accessible only through ProxoolFacade. This is causing multiple connection factories to underneath share the same connection pools, which can result in bugs such as #1275551 when multiple factories cannot create pool with the same name. The solution to this problem would be for Proxool ConnectionPoolManager to do not be a singleton so each ProxoolDatabaseConnectionFactoryImpl can have its own connection pool manager.
| Field Summary |
|---|
| Fields inherited from class org.opensubsystems.core.persist.db.connectionpool.PooledDatabaseConnectionFactoryImpl |
|---|
DEFAULT_DATASOURCE_NAME, m_defaultConnectionPool, m_mpConnectionPoolCrossRef, m_mpConnectionPools, m_mpNotPooledConnections |
| Constructor Summary | |
|---|---|
ProxoolDatabaseConnectionFactoryImpl()
Constructor for new instance using default database properties. |
|
ProxoolDatabaseConnectionFactoryImpl(DatabaseTransactionFactoryImpl transactionFactory)
Constructor for new instance using default database properties. |
|
ProxoolDatabaseConnectionFactoryImpl(java.lang.String strDriver,
java.lang.String strURL,
java.lang.String strUser,
java.lang.String strPassword,
DatabaseTransactionFactoryImpl transactionFactory)
Constructor for new instance using explicitely specified properties. |
|
| Method Summary | |
|---|---|
protected void |
closeConnectionPool(org.opensubsystems.core.persist.db.connectionpool.PooledDatabaseConnectionFactoryImpl.ConnectionPoolDefinition connectionpool)
Close the specified connection pool and all connections maintained to database by this connection pool. |
protected java.lang.Object |
createConnectionPool(java.lang.String strConnectionPoolName,
java.lang.String strDriverName,
java.lang.String strUrl,
java.lang.String strUser,
java.lang.String strPassword)
Create new connection pool with specified parameters. |
protected java.sql.Connection |
getPooledConnection(org.opensubsystems.core.persist.db.connectionpool.PooledDatabaseConnectionFactoryImpl.ConnectionPoolDefinition connectionpool)
Get connection for given connection pool. |
protected java.sql.Connection |
getPooledConnection(org.opensubsystems.core.persist.db.connectionpool.PooledDatabaseConnectionFactoryImpl.ConnectionPoolDefinition connectionpool,
java.lang.String strUser,
java.lang.String strPassword)
Get connection using the same settings as given connection pool but get the connection under different name and password. |
| Methods inherited from class org.opensubsystems.core.persist.db.connectionpool.PooledDatabaseConnectionFactoryImpl |
|---|
addDataSource, debug, getDefaultDataSourceName, getRequestedConnectionCount, getRequestedConnectionCount, isDataSourceDefined, requestNonTransactionalConnection, requestNonTransactionalConnection, requestNonTransactionalConnection, requestNonTransactionalConnection, returnNonTransactionalConnection, returnPooledConnection, setDefaultDataSourceName, start, stop |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ProxoolDatabaseConnectionFactoryImpl()
throws OSSConfigException,
OSSDatabaseAccessException
OSSConfigException - - if there was an error accessing default database
properties
OSSDatabaseAccessException - - problem accessing the database
public ProxoolDatabaseConnectionFactoryImpl(DatabaseTransactionFactoryImpl transactionFactory)
throws OSSConfigException,
OSSDatabaseAccessException
transactionFactory - - transaction factory to use for this
connection factory, can be null
OSSConfigException - - if there was an error accessing default database
properties
OSSDatabaseAccessException - - problem accessing the database
public ProxoolDatabaseConnectionFactoryImpl(java.lang.String strDriver,
java.lang.String strURL,
java.lang.String strUser,
java.lang.String strPassword,
DatabaseTransactionFactoryImpl transactionFactory)
throws OSSConfigException,
OSSDatabaseAccessException
strDriver - - JDBC driver to connect to the databasestrURL - - URL of database to connect tostrUser - - user name to connect to the databasestrPassword - - password to the databasetransactionFactory - - transaction factory to use for this
connection factory, can be null
OSSConfigException - - problem accessing or locating the config file.
OSSDatabaseAccessException - - problem accessing the database| Method Detail |
|---|
protected java.sql.Connection getPooledConnection(org.opensubsystems.core.persist.db.connectionpool.PooledDatabaseConnectionFactoryImpl.ConnectionPoolDefinition connectionpool)
throws OSSDatabaseAccessException
getPooledConnection in class PooledDatabaseConnectionFactoryImplconnectionpool - - connection pool to get connection for
OSSDatabaseAccessException - - an error getting connection
protected java.sql.Connection getPooledConnection(org.opensubsystems.core.persist.db.connectionpool.PooledDatabaseConnectionFactoryImpl.ConnectionPoolDefinition connectionpool,
java.lang.String strUser,
java.lang.String strPassword)
throws OSSDatabaseAccessException
getPooledConnection in class PooledDatabaseConnectionFactoryImplconnectionpool - - connection pool defining settings to get connection forstrUser - - user name to get the connection forstrPassword - - password to get the connection for
OSSDatabaseAccessException - - an error getting connection
protected java.lang.Object createConnectionPool(java.lang.String strConnectionPoolName,
java.lang.String strDriverName,
java.lang.String strUrl,
java.lang.String strUser,
java.lang.String strPassword)
throws OSSException
createConnectionPool in class PooledDatabaseConnectionFactoryImplstrConnectionPoolName - - connection pool namestrDriverName - - name of the JDBC driverstrUrl - - url by which data source connects to the databasestrUser - - user name to connects to the databasestrPassword - - password to connects to the database
OSSException - - an error has occured during creation of connection pool
protected void closeConnectionPool(org.opensubsystems.core.persist.db.connectionpool.PooledDatabaseConnectionFactoryImpl.ConnectionPoolDefinition connectionpool)
throws OSSException
closeConnectionPool in class PooledDatabaseConnectionFactoryImplconnectionpool - - connection pool to close.
OSSException - - an error has occured during closing of the connection pool
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||