org.apache.commons.dbcp.managed
Class PoolableManagedConnectionFactory

java.lang.Object
  extended by org.apache.commons.dbcp.PoolableConnectionFactory
      extended by org.apache.commons.dbcp.managed.PoolableManagedConnectionFactory

public class PoolableManagedConnectionFactory
extends PoolableConnectionFactory

A PoolableConnectionFactory that creates PoolableManagedConnections.

Version:
$Revision$ $Date$

Constructor Summary
PoolableManagedConnectionFactory(XAConnectionFactory connFactory, ObjectPool pool, KeyedObjectPoolFactory stmtPoolFactory, String validationQuery, boolean defaultReadOnly, boolean defaultAutoCommit)
          Create a PoolableManagedConnectionFactory and attach it to a connection pool.
PoolableManagedConnectionFactory(XAConnectionFactory connFactory, ObjectPool pool, KeyedObjectPoolFactory stmtPoolFactory, String validationQuery, int validationQueryTimeout, Collection connectionInitSqls, Boolean defaultReadOnly, boolean defaultAutoCommit, int defaultTransactionIsolation, String defaultCatalog, AbandonedConfig config)
          Create a PoolableManagedConnectionFactory and attach it to a connection pool.
 
Method Summary
 Object makeObject()
          Uses the configured XAConnectionFactory to create a PoolableManagedConnection.
 
Methods inherited from class org.apache.commons.dbcp.PoolableConnectionFactory
activateObject, destroyObject, getPool, passivateObject, setConnectionFactory, setConnectionInitSql, setDefaultAutoCommit, setDefaultCatalog, setDefaultReadOnly, setDefaultTransactionIsolation, setPool, setStatementPoolFactory, setValidationQuery, setValidationQueryTimeout, validateConnection, validateObject
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PoolableManagedConnectionFactory

public PoolableManagedConnectionFactory(XAConnectionFactory connFactory,
                                        ObjectPool pool,
                                        KeyedObjectPoolFactory stmtPoolFactory,
                                        String validationQuery,
                                        boolean defaultReadOnly,
                                        boolean defaultAutoCommit)
Create a PoolableManagedConnectionFactory and attach it to a connection pool.

Parameters:
connFactory - XAConnectionFactory
pool - connection pool
stmtPoolFactory - the KeyedObjectPoolFactory to use to create KeyedObjectPools for pooling PreparedStatements, or null to disable PreparedStatement pooling
validationQuery - a query to use to validate Connections. Should return at least one row. Using null turns off validation.
defaultReadOnly - the default "read only" setting for borrowed Connections
defaultAutoCommit - the default "auto commit" setting for returned Connections

PoolableManagedConnectionFactory

public PoolableManagedConnectionFactory(XAConnectionFactory connFactory,
                                        ObjectPool pool,
                                        KeyedObjectPoolFactory stmtPoolFactory,
                                        String validationQuery,
                                        int validationQueryTimeout,
                                        Collection connectionInitSqls,
                                        Boolean defaultReadOnly,
                                        boolean defaultAutoCommit,
                                        int defaultTransactionIsolation,
                                        String defaultCatalog,
                                        AbandonedConfig config)
Create a PoolableManagedConnectionFactory and attach it to a connection pool.

Parameters:
connFactory - XAConnectionFactory
pool - connection pool
stmtPoolFactory - the KeyedObjectPoolFactory to use to create KeyedObjectPools for pooling PreparedStatements, or null to disable PreparedStatement pooling
validationQuery - a query to use to validate Connections. Should return at least one row. Using null turns off validation.
validationQueryTimeout - the number of seconds that validation queries will wait for database response before failing. Use a value less than or equal to 0 for no timeout.
connectionInitSqls - a Collection of SQL statements to initialize Connections. Using null turns off initialization.
defaultReadOnly - the default "read only" setting for borrowed Connections
defaultAutoCommit - the default "auto commit" setting for returned Connections
defaultTransactionIsolation - the default "Transaction Isolation" setting for returned Connections
defaultCatalog - the default "catalog" setting for returned Connections
config - the AbandonedConfig if tracing SQL objects
Method Detail

makeObject

public Object makeObject()
                  throws Exception
Uses the configured XAConnectionFactory to create a PoolableManagedConnection. Throws IllegalStateException if the connection factory returns null. Also initializes the connection using configured initialization sql (if provided) and sets up a prepared statement pool associated with the PoolableManagedConnection if statement pooling is enabled.

Overrides:
makeObject in class PoolableConnectionFactory
Throws:
Exception


Copyright © 2001-2004 Apache Software Foundation. Documenation generated April 11 2013.