Class DBConnectionPool

java.lang.Object
org.eclnt.ccee.db.dofw.DBConnectionPool
All Implemented Interfaces:
ICCEEConstants

public class DBConnectionPool extends Object implements ICCEEConstants
Simple connection pool implementation.

Connections are pooled per context name and tenant by default.

Connections are rolled back when added to the pool - and the are checked before being transferred from the pool to the caller.
  • Constructor Details

    • DBConnectionPool

      public DBConnectionPool()
  • Method Details

    • initConnectionChecker

      public static void initConnectionChecker(IDBConnectionPoolConnectionChecker connectionChecker)
      Pass own implementation of IDBConnectionPoolConnectionChecker that is used instead of the default one.
    • initAccessKeyBuilder

      public static void initAccessKeyBuilder(IDBConnectionPoolAccessKeyBuilder accessKeyBuilder)
      Pass own implementation of IDBConnectionPoolAccessKeyBuilder that is used instead of the default one.
    • addToPool

      public static void addToPool(String contextName, Connection conn)
      Add a connection to the pool for the given context name.
    • pickFromPool

      public static Connection pickFromPool(String contextName)
      Pick a connection from the pool for the given context name. If no connection is available, null is returned. The caller needs to check for null and create a new connection in this case.
    • closeAllConnections

      public static void closeAllConnections()
      Close all connections in all pools.