Class PoolableConnection

All Implemented Interfaces:
AutoCloseable, Connection, Wrapper, PoolableConnectionMXBean, 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
  • Constructor Details

    • PoolableConnection

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

      public PoolableConnection(Connection conn, ObjectPool<PoolableConnection> pool, ObjectName jmxObjectName, Collection<String> disconnectSqlCodes, boolean fastFailValidation)
      Parameters:
      conn - my underlying connection
      pool - the pool to which I should return when closed
      jmxObjectName - 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)
  • Method Details