|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.ojb.broker.accesslayer.ConnectionFactoryAbstractImpl
org.apache.ojb.broker.accesslayer.ConnectionFactoryDBCPImpl
ConnectionFactory implementation using Commons DBCP and Commons Pool API to pool connections. Based on a proposal of Dirk Verbeek - Thanks.
Field Summary | |
static java.lang.String |
PARAM_NAME_POOL_STATEMENTS
|
static java.lang.String |
PARAM_NAME_STATEMENT_POOL_MAX_TOTAL
|
static java.lang.String |
PARAM_NAME_UNWRAP_ALLOWED
|
Constructor Summary | |
ConnectionFactoryDBCPImpl()
|
Method Summary | |
java.sql.Connection |
checkOutJdbcConnection(JdbcConnectionDescriptor jcd)
Returns a valid JDBC Connection. |
void |
releaseAllResources()
Closes all managed pools. |
void |
releaseJdbcConnection(JdbcConnectionDescriptor jcd,
java.sql.Connection con)
Releases a Connection after use. |
Methods inherited from class org.apache.ojb.broker.accesslayer.ConnectionFactoryAbstractImpl |
lookupConnection, releaseConnection |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String PARAM_NAME_UNWRAP_ALLOWED
public static final java.lang.String PARAM_NAME_POOL_STATEMENTS
public static final java.lang.String PARAM_NAME_STATEMENT_POOL_MAX_TOTAL
Constructor Detail |
public ConnectionFactoryDBCPImpl()
Method Detail |
public java.sql.Connection checkOutJdbcConnection(JdbcConnectionDescriptor jcd) throws LookupException
ConnectionFactoryAbstractImpl
Note: This method is never called for a jdbc-connection-descriptor that uses datasources, OJB only manages connections from DriverManager.
Note: If the concrete implementation does not callback to
#newConnectionFromDriverManager(org.apache.ojb.broker.metadata.JdbcConnectionDescriptor)
when creating a new Connection, it must call
#initializeJdbcConnection(java.sql.Connection, org.apache.ojb.broker.metadata.JdbcConnectionDescriptor)
so that the platform implementation can peform any RDBMS-specific init tasks for newly
created Connection objetcs.
checkOutJdbcConnection
in class ConnectionFactoryAbstractImpl
jcd
- the connection descriptor for which to return a validated Connection
LookupException
- if a valid Connection could not be obtainedpublic void releaseJdbcConnection(JdbcConnectionDescriptor jcd, java.sql.Connection con) throws LookupException
ConnectionFactoryAbstractImpl
Note: This method is never called for a jdbc-connection-descriptor that uses datasources, OJB only manages connections from DriverManager.
releaseJdbcConnection
in class ConnectionFactoryAbstractImpl
jcd
- the connection descriptor for which the connection was createdcon
- the connection to release.
Callers must guarantee that the passed connection was obtained by calling
ConnectionFactoryAbstractImpl.checkOutJdbcConnection(org.apache.ojb.broker.metadata.JdbcConnectionDescriptor)
.
LookupException
- if errors occured during release of object. Typically happens
if return of object to pool fails in a pooled implementation.public void releaseAllResources()
releaseAllResources
in interface ConnectionFactory
releaseAllResources
in class ConnectionFactoryAbstractImpl
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |