Package com.groiss.store
Class DBConnPool
java.lang.Object
com.groiss.store.DBConnPool
This class maintains a pool of database connections.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
completeTransaction
(boolean commit) Completes the database transaction (commit or rollback).static boolean
static Connection
The method returns a database connection.static int
static int
static int
static boolean
Determines if the connection pool has been loaded and a connection is available.boolean
Ask the object if it has been startedstatic void
setQueryTimeout
(int s) void
shutdown()
This method is called on shutdown.void
startup()
This method is called when the object is "started".Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.groiss.component.Service
reconfigure
-
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". -
shutdown
public void shutdown()Description copied from interface:Lifecycle
This method is called on shutdown. -
isRunning
public boolean isRunning()Description copied from interface:Service
Ask the object if it has been started -
getGlobalQueryTimeout
public static int getGlobalQueryTimeout() -
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()
-