Package org.apache.commons.dbcp2.managed
Class PoolableManagedConnectionFactory
- java.lang.Object
-
- org.apache.commons.dbcp2.PoolableConnectionFactory
-
- org.apache.commons.dbcp2.managed.PoolableManagedConnectionFactory
-
- All Implemented Interfaces:
org.apache.commons.pool2.PooledObjectFactory<PoolableConnection>
public class PoolableManagedConnectionFactory extends PoolableConnectionFactory
APoolableConnectionFactory
that createsPoolableManagedConnection
s.- Since:
- 2.0
- Version:
- $Id: PoolableManagedConnectionFactory.java 1659452 2015-02-13 04:00:39Z psteitz $
-
-
Constructor Summary
Constructors Constructor Description PoolableManagedConnectionFactory(XAConnectionFactory connFactory, javax.management.ObjectName dataSourceJmxName)
Create a PoolableManagedConnectionFactory and attach it to a connection pool.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.commons.pool2.PooledObject<PoolableConnection>
makeObject()
Uses the configured XAConnectionFactory to create aPoolableManagedConnection
.-
Methods inherited from class org.apache.commons.dbcp2.PoolableConnectionFactory
activateObject, destroyObject, getDefaultQueryTimeout, getDisconnectionSqlCodes, getPool, isEnableAutoCommitOnReturn, isFastFailValidation, isRollbackOnReturn, passivateObject, setCacheState, setConnectionInitSql, setDefaultAutoCommit, setDefaultCatalog, setDefaultQueryTimeout, setDefaultReadOnly, setDefaultTransactionIsolation, setDisconnectionSqlCodes, setEnableAutoCommitOnReturn, setFastFailValidation, setMaxConnLifetimeMillis, setMaxOpenPrepatedStatements, setPool, setPoolStatements, setRollbackOnReturn, setValidationQuery, setValidationQueryTimeout, validateConnection, validateObject
-
-
-
-
Constructor Detail
-
PoolableManagedConnectionFactory
public PoolableManagedConnectionFactory(XAConnectionFactory connFactory, javax.management.ObjectName dataSourceJmxName)
Create a PoolableManagedConnectionFactory and attach it to a connection pool.- Parameters:
connFactory
- XAConnectionFactory
-
-
Method Detail
-
makeObject
public org.apache.commons.pool2.PooledObject<PoolableConnection> makeObject() throws java.lang.Exception
Uses the configured XAConnectionFactory to create aPoolableManagedConnection
. ThrowsIllegalStateException
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.- Specified by:
makeObject
in interfaceorg.apache.commons.pool2.PooledObjectFactory<PoolableConnection>
- Overrides:
makeObject
in classPoolableConnectionFactory
- Throws:
java.lang.Exception
-
-