Class DBConnPool

java.lang.Object
com.groiss.store.DBConnPool
All Implemented Interfaces:
Lifecycle, Service

public class DBConnPool extends Object implements Service
This class maintains a pool of database connections.
  • Constructor Details

    • DBConnPool

      public DBConnPool()
  • Method Details

    • startup

      public void startup()
      Description copied from interface: Lifecycle
      This method is called when the object is "started".
      Specified by:
      startup in interface Lifecycle
    • shutdown

      public void shutdown()
      Description copied from interface: Lifecycle
      This method is called on shutdown.
      Specified by:
      shutdown in interface Lifecycle
    • isRunning

      public boolean isRunning()
      Description copied from interface: Service
      Ask the object if it has been started
      Specified by:
      isRunning in interface Service
      Returns:
      true if running.
    • getGlobalQueryTimeout

      public static int getGlobalQueryTimeout()
    • getConnection

      public static Connection getConnection()
      The method returns a database connection. Called in the same transaction, the method will always return the same connection.
      Returns:
      a database connection
    • completeTransaction

      public static void completeTransaction(boolean commit)
      Completes the database transaction (commit or rollback). Releases all db-connections of this transaction.
      Parameters:
      commit - if true, a commit is performed, if false a rollback is performed.
    • isAvailable

      public static boolean isAvailable()
      Determines if the connection pool has been loaded and a connection is available.
    • getConnectionCount

      public static int getConnectionCount()
    • setQueryTimeout

      public static void setQueryTimeout(int s)
    • getQueryTimeout

      public static int getQueryTimeout()
    • doLogDBSessionId

      public static boolean doLogDBSessionId()