Class PoolableConnection

All Implemented Interfaces:
AutoCloseable, Connection, Wrapper, PoolableConnectionMXBean, org.apache.commons.pool2.TrackedUse
Direct Known Subclasses:
PoolableManagedConnection

public class PoolableConnection extends DelegatingConnection<Connection> implements PoolableConnectionMXBean
A delegating connection that, rather than closing the underlying connection, returns itself to an ObjectPool when closed.
Since:
2.0
Version:
$Id: PoolableConnection.java 1658644 2015-02-10 08:59:07Z tn $
Author:
Rodney Waldhoff, Glenn L. Nielsen, James House
  • Constructor Details

    • PoolableConnection

      public PoolableConnection(Connection conn, org.apache.commons.pool2.ObjectPool<PoolableConnection> pool, ObjectName jmxName, Collection<String> disconnectSqlCodes, boolean fastFailValidation)
      Parameters:
      conn - my underlying connection
      pool - the pool to which I should return when closed
      jmxName - JMX name
      disconnectSqlCodes - SQL_STATE codes considered fatal disconnection errors
      fastFailValidation - true means fatal disconnection errors cause subsequent validations to fail immediately (no attempt to run query or isValid)
    • PoolableConnection

      public PoolableConnection(Connection conn, org.apache.commons.pool2.ObjectPool<PoolableConnection> pool, ObjectName jmxName)
      Parameters:
      conn - my underlying connection
      pool - the pool to which I should return when closed
      jmxName - JMX name
  • Method Details