Class PooledConnectionMgr

java.lang.Object
fc.jdbc.ConnectionMgr
fc.jdbc.PooledConnectionMgr

public final class PooledConnectionMgr extends ConnectionMgr
A pooled connection manager. Connections must be closed when done with, which automatically returns them back to the pool.
  • Field Details

  • Constructor Details

  • Method Details

    • setDebugCheckout

      public void setDebugCheckout(boolean dbg)
      Helps to debug connection checkouts. By default, this is false (since there is a stack trace overhead per connection when debugging is enabled).
      Parameters:
      dbg - true to enable tracking of checked out connections from this pool. false stops tracking and clears any existing tracking info.
    • getCheckoutInfo

      Returns a iterator over a collection of Exception objects, each containing a stack trace for code that has currently checked out a connection from this pool. For this to work, make sure that setDebugCheckout(boolean) has first been invoked with true.
    • getHungTransactions

      public List getHungTransactions(long milliseconds)
      Gets a list of connections in the pool such that each connection has a transaction that was started more than the specified milliseconds ago but has not yet been aborted or commited (this is a good way to see if there is a transaction leak somewhere).
    • toString

      public String toString()
      Overrides:
      toString in class ConnectionMgr
    • main

      public static void main(String[] args) throws Exception
      Throws:
      Exception