Class PoolableManagedConnectionFactory

java.lang.Object
org.apache.tomcat.dbcp.dbcp2.PoolableConnectionFactory
org.apache.tomcat.dbcp.dbcp2.managed.PoolableManagedConnectionFactory
All Implemented Interfaces:
PooledObjectFactory<PoolableConnection>

public class PoolableManagedConnectionFactory extends PoolableConnectionFactory
Since:
2.0
  • Constructor Details

    • PoolableManagedConnectionFactory

      public PoolableManagedConnectionFactory(XAConnectionFactory connFactory, ObjectName dataSourceJmxName)
      Creates a PoolableManagedConnectionFactory and attach it to a connection pool.
      Parameters:
      connFactory - XAConnectionFactory
      dataSourceJmxName - The data source name.
  • Method Details

    • getTransactionRegistry

      public TransactionRegistry getTransactionRegistry()
      Returns:
      The transaction registry.
      Since:
      2.6.0
    • makeObject

      public PooledObject<PoolableConnection> 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.
      Specified by:
      makeObject in interface PooledObjectFactory<PoolableConnection>
      Overrides:
      makeObject in class PoolableConnectionFactory
      Returns:
      a PooledObject wrapping an instance that can be served by the pool
      Throws:
      Exception - if there is a problem creating a new instance, this will be propagated to the code requesting an object.