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>
A
PoolableConnectionFactory that creates PoolableManagedConnections.- Since:
- 2.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final TransactionRegistryTransaction registry associated with connections created by this factory -
Constructor Summary
ConstructorsConstructorDescriptionPoolableManagedConnectionFactory(XAConnectionFactory connFactory, ObjectName dataSourceJmxName) Creates a PoolableManagedConnectionFactory and attach it to a connection pool. -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.commons.pool2.PooledObject<PoolableConnection> Uses the configured XAConnectionFactory to create aPoolableManagedConnection.Methods inherited from class org.apache.commons.dbcp2.PoolableConnectionFactory
activateObject, destroyObject, destroyObject, getCacheState, getConnectionFactory, getConnectionIndex, getConnectionInitSqls, getDataSourceJmxName, getDataSourceJmxObjectName, getDefaultAutoCommit, getDefaultCatalog, getDefaultQueryTimeout, getDefaultQueryTimeoutDuration, getDefaultQueryTimeoutSeconds, getDefaultReadOnly, getDefaultSchema, getDefaultTransactionIsolation, getDisconnectionSqlCodes, getMaxConnDuration, getMaxConnLifetimeMillis, getMaxOpenPreparedStatements, getPool, getPoolStatements, getValidationQuery, getValidationQueryTimeoutDuration, getValidationQueryTimeoutSeconds, initializeConnection, isAutoCommitOnReturn, isEnableAutoCommitOnReturn, isFastFailValidation, isRollbackOnReturn, passivateObject, setAutoCommitOnReturn, setCacheState, setClearStatementPoolOnReturn, setConnectionInitSql, setDefaultAutoCommit, setDefaultCatalog, setDefaultQueryTimeout, setDefaultQueryTimeout, setDefaultReadOnly, setDefaultSchema, setDefaultTransactionIsolation, setDisconnectionSqlCodes, setEnableAutoCommitOnReturn, setFastFailValidation, setMaxConn, setMaxConnLifetimeMillis, setMaxOpenPreparedStatements, setMaxOpenPrepatedStatements, setPool, setPoolStatements, setRollbackOnReturn, setValidationQuery, setValidationQueryTimeout, setValidationQueryTimeout, validateConnection, validateObject
-
Field Details
-
transactionRegistry
Transaction registry associated with connections created by this factory
-
-
Constructor Details
-
PoolableManagedConnectionFactory
public PoolableManagedConnectionFactory(XAConnectionFactory connFactory, ObjectName dataSourceJmxName) Creates a PoolableManagedConnectionFactory and attach it to a connection pool.- Parameters:
connFactory- XAConnectionFactorydataSourceJmxName- The data source name.
-
-
Method Details
-
getTransactionRegistry
- Returns:
- The transaction registry.
- Since:
- 2.6.0
-
makeObject
Uses the configured XAConnectionFactory to create aPoolableManagedConnection. ThrowsIllegalStateExceptionif 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:
makeObjectin interfaceorg.apache.commons.pool2.PooledObjectFactory<PoolableConnection>- Overrides:
makeObjectin classPoolableConnectionFactory- Throws:
SQLException
-