public abstract class ConnectionFactoryAbstractImpl extends java.lang.Object implements ConnectionFactory
ConnectionFactory
's.Constructor and Description |
---|
ConnectionFactoryAbstractImpl() |
Modifier and Type | Method and Description |
---|---|
abstract java.sql.Connection |
checkOutJdbcConnection(JdbcConnectionDescriptor jcd)
Returns a valid JDBC Connection.
|
java.sql.Connection |
lookupConnection(JdbcConnectionDescriptor jcd)
Lookup a connection from the connection factory implementation.
|
void |
releaseAllResources()
Override this method to do cleanup in your implementation.
|
void |
releaseConnection(JdbcConnectionDescriptor jcd,
java.sql.Connection con)
Release connection - CAUTION: Release every connection after use to avoid abandoned connections.
|
abstract void |
releaseJdbcConnection(JdbcConnectionDescriptor jcd,
java.sql.Connection con)
Releases a Connection after use.
|
public abstract java.sql.Connection checkOutJdbcConnection(JdbcConnectionDescriptor jcd) throws LookupException
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.
jcd
- the connection descriptor for which to return a validated ConnectionLookupException
- if a valid Connection could not be obtainedpublic abstract void releaseJdbcConnection(JdbcConnectionDescriptor jcd, java.sql.Connection con) throws LookupException
Note: This method is never called for a jdbc-connection-descriptor that uses datasources, OJB only manages connections from DriverManager.
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
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 releaseConnection(JdbcConnectionDescriptor jcd, java.sql.Connection con)
ConnectionFactory
releaseConnection
in interface ConnectionFactory
public java.sql.Connection lookupConnection(JdbcConnectionDescriptor jcd) throws LookupException
ConnectionFactory
lookupConnection
in interface ConnectionFactory
LookupException
public void releaseAllResources()
releaseAllResources
in interface ConnectionFactory
(C) 2002 - 2005 Apache Software Foundation
All rights reserved. Published under the Apache License 2.0.
http://db.apache.org/ojb
Version: 1.0.4, 2005-12-30