public final class PooledConnectionMgr extends ConnectionMgr
Modifier and Type | Field and Description |
---|---|
static long |
ConnectionTimeoutWarning
If a connection cannot be obtained within this time,
then a warning will be logged.
|
static int |
defaultSize |
Constructor and Description |
---|
PooledConnectionMgr(PropertyMgr props,
int size)
Constructs a new connection pool with the specified size.
|
PooledConnectionMgr(PropertyMgr props,
String prefix,
int size)
Constructs a new connection pool with the specified size.
|
PooledConnectionMgr(String jdbc_url,
String jdbc_driver,
String jdbc_user,
String jdbc_password,
String jdbc_catalog,
int size)
Constructs a new connection pool with the specified size.
|
PooledConnectionMgr(SystemLog log,
PropertyMgr props,
int size)
Constructs a new connection pool with the specified size.
|
PooledConnectionMgr(SystemLog log,
PropertyMgr props,
String prefix,
int size)
Constructs a new connection pool with the specified size.
|
Modifier and Type | Method and Description |
---|---|
Iterator |
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.
|
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).
|
static void |
main(String[] args) |
void |
setDebugCheckout(boolean dbg)
Helps to debug connection checkouts.
|
String |
toString() |
close, getConnection, getDBName, getDriver, getURL, setCatalog
public static final int defaultSize
public static final long ConnectionTimeoutWarning
public PooledConnectionMgr(String jdbc_url, String jdbc_driver, String jdbc_user, String jdbc_password, String jdbc_catalog, int size) throws Exception
ConnectionMgr
Exception
public PooledConnectionMgr(PropertyMgr props, int size) throws Exception
Exception
public PooledConnectionMgr(PropertyMgr props, String prefix, int size) throws Exception
Exception
public PooledConnectionMgr(SystemLog log, PropertyMgr props, int size) throws Exception
Exception
public PooledConnectionMgr(SystemLog log, PropertyMgr props, String prefix, int size) throws Exception
Exception
public void setDebugCheckout(boolean dbg)
dbg
- true to enable tracking of checked out
connections from this pool. false
stops tracking and clears any existing tracking
info.public Iterator getCheckoutInfo()
setDebugCheckout(boolean)
has first been invoked with
true.public List getHungTransactions(long milliseconds)
public String toString()
toString
in class ConnectionMgr