org.cloudgraph.rdb.connect
Class RDBConnectionManager

java.lang.Object
  extended by org.cloudgraph.rdb.connect.RDBConnectionManager

public class RDBConnectionManager
extends Object


Field Summary
static String DBCP_CONNECTIONINITSQLS
          NOTE: Versions 1.3 and 1.4 of DBCP incorrectly use "initConnectionSqls" as the name of this property for JNDI object factory configuration.
static String DBCP_DEFAULTAUTOCOMMIT
          Default: true The default auto-commit state of connections created by this pool.
static String DBCP_DEFAULTCATALOG
          Default: The default catalog of connections created by this pool.
static String DBCP_DEFAULTREADONLY
          Default: driver default The default read-only state of connections created by this pool.
static String DBCP_DEFAULTTRANSACTIONISOLATION
          Default: driver default The default TransactionIsolation state of connections created by this pool.
static String DBCP_INITIALSIZE
          Default: 0 The initial number of connections that are created when the pool is started.
static String DBCP_LOGABANDONED
          Default: false Flag to log stack traces for application code which abandoned a Statement or Connection.
static String DBCP_MAXACTIVE
          Default: 8 The maximum number of active connections that can be allocated from this pool at the same time, or negative for no limit.
static String DBCP_MAXIDLE
          Default: 8 The maximum number of connections that can remain idle in the pool, without extra ones being released, or negative for no limit.
static String DBCP_MAXWAIT
          Default: indefinitely The maximum number of milliseconds that the pool will wait (when there are no available connections) for a connection to be returned before throwing an exception, or -1 to wait indefinitely.
static String DBCP_MINEVICTABLEIDLETIMEMILLIS
          Default: 1000 * 60 * 30 The minimum amount of time an object may sit idle in the pool before it is eligable for eviction by the idle object evictor (if any).
static String DBCP_MINIDLE
          Default: 0 The minimum number of connections that can remain idle in the pool, without extra ones being created, or zero to create none.
static String DBCP_NUMTESTSPEREVICTIONRUN
          Default: 3 The number of objects to examine during each run of the idle object evictor thread (if any).
static String DBCP_REMOVEABANDONED
          Default: false Flag to remove abandoned connections if they exceed the removeAbandonedTimout.
static String DBCP_REMOVEABANDONEDTIMEOUT
          Default: 300 Timeout in seconds before an abandoned connection can be removed.
static String DBCP_TESTONBORROW
          Default: true The indication of whether objects will be validated before being borrowed from the pool.
static String DBCP_TESTONRETURN
          Default: false The indication of whether objects will be validated before being returned to the pool.
static String DBCP_TESTWHILEIDLE
          Default: false The indication of whether objects will be validated by the idle object evictor (if any).
static String DBCP_TIMEBETWEENEVICTIONRUNSMILLIS
          Default: -1 The number of milliseconds to sleep between runs of the idle object evictor thread.
static String DBCP_VALIDATIONQUERY
          The SQL query that will be used to validate connections from this pool before returning them to the caller.
 
Method Summary
protected  void finalize()
           
 Connection getConnection()
           
 int getNumLockedProcesses()
          getNumLockedProcesses - gets the number of currently locked processes on the MySQL db
static RDBConnectionManager instance()
           
static void printDriverStats()
           
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DBCP_DEFAULTAUTOCOMMIT

public static final String DBCP_DEFAULTAUTOCOMMIT
Default: true The default auto-commit state of connections created by this pool.

See Also:
Constant Field Values

DBCP_DEFAULTREADONLY

public static final String DBCP_DEFAULTREADONLY
Default: driver default The default read-only state of connections created by this pool. If not set then the setReadOnly method will not be called. (Some drivers don't support read only mode, ex: Informix)

See Also:
Constant Field Values

DBCP_DEFAULTTRANSACTIONISOLATION

public static final String DBCP_DEFAULTTRANSACTIONISOLATION
Default: driver default The default TransactionIsolation state of connections created by this pool. One of the following: (see javadoc)

See Also:
Constant Field Values

DBCP_DEFAULTCATALOG

public static final String DBCP_DEFAULTCATALOG
Default: The default catalog of connections created by this pool.

See Also:
Constant Field Values

DBCP_INITIALSIZE

public static final String DBCP_INITIALSIZE
Default: 0 The initial number of connections that are created when the pool is started. Since: 1.2

See Also:
Constant Field Values

DBCP_MAXACTIVE

public static final String DBCP_MAXACTIVE
Default: 8 The maximum number of active connections that can be allocated from this pool at the same time, or negative for no limit.

See Also:
Constant Field Values

DBCP_MAXIDLE

public static final String DBCP_MAXIDLE
Default: 8 The maximum number of connections that can remain idle in the pool, without extra ones being released, or negative for no limit.

See Also:
Constant Field Values

DBCP_MINIDLE

public static final String DBCP_MINIDLE
Default: 0 The minimum number of connections that can remain idle in the pool, without extra ones being created, or zero to create none.

See Also:
Constant Field Values

DBCP_MAXWAIT

public static final String DBCP_MAXWAIT
Default: indefinitely The maximum number of milliseconds that the pool will wait (when there are no available connections) for a connection to be returned before throwing an exception, or -1 to wait indefinitely.

See Also:
Constant Field Values

DBCP_VALIDATIONQUERY

public static final String DBCP_VALIDATIONQUERY
The SQL query that will be used to validate connections from this pool before returning them to the caller. If specified, this query MUST be an SQL SELECT statement that returns at least one row.

See Also:
Constant Field Values

DBCP_TESTONBORROW

public static final String DBCP_TESTONBORROW
Default: true The indication of whether objects will be validated before being borrowed from the pool. If the object fails to validate, it will be dropped from the pool, and we will attempt to borrow another. NOTE - for a true value to have any effect, the validationQuery parameter must be set to a non-null string.

See Also:
Constant Field Values

DBCP_TESTONRETURN

public static final String DBCP_TESTONRETURN
Default: false The indication of whether objects will be validated before being returned to the pool. NOTE - for a true value to have any effect, the validationQuery parameter must be set to a non-null string.

See Also:
Constant Field Values

DBCP_TESTWHILEIDLE

public static final String DBCP_TESTWHILEIDLE
Default: false The indication of whether objects will be validated by the idle object evictor (if any). If an object fails to validate, it will be dropped from the pool. NOTE - for a true value to have any effect, the validationQuery parameter must be set to a non-null string.

See Also:
Constant Field Values

DBCP_TIMEBETWEENEVICTIONRUNSMILLIS

public static final String DBCP_TIMEBETWEENEVICTIONRUNSMILLIS
Default: -1 The number of milliseconds to sleep between runs of the idle object evictor thread. When non-positive, no idle object evictor thread will be run.

See Also:
Constant Field Values

DBCP_NUMTESTSPEREVICTIONRUN

public static final String DBCP_NUMTESTSPEREVICTIONRUN
Default: 3 The number of objects to examine during each run of the idle object evictor thread (if any).

See Also:
Constant Field Values

DBCP_MINEVICTABLEIDLETIMEMILLIS

public static final String DBCP_MINEVICTABLEIDLETIMEMILLIS
Default: 1000 * 60 * 30 The minimum amount of time an object may sit idle in the pool before it is eligable for eviction by the idle object evictor (if any).

See Also:
Constant Field Values

DBCP_CONNECTIONINITSQLS

public static final String DBCP_CONNECTIONINITSQLS
NOTE: Versions 1.3 and 1.4 of DBCP incorrectly use "initConnectionSqls" as the name of this property for JNDI object factory configuration. Until 1.3.1/1.4.1 are released, "initConnectionSqls" must be used as the name for this property when using BasicDataSoureFactory to create BasicDataSource instances via JNDI. null A Collection of SQL statements that will be used to initialize physical connections when they are first created. These statements are executed only once - when the configured connection factory creates the connection.

See Also:
Constant Field Values

DBCP_REMOVEABANDONED

public static final String DBCP_REMOVEABANDONED
Default: false Flag to remove abandoned connections if they exceed the removeAbandonedTimout. If set to true a connection is considered abandoned and eligible for removal if it has been idle longer than the removeAbandonedTimeout. Setting this to true can recover db connections from poorly written applications which fail to close a connection.

See Also:
Constant Field Values

DBCP_REMOVEABANDONEDTIMEOUT

public static final String DBCP_REMOVEABANDONEDTIMEOUT
Default: 300 Timeout in seconds before an abandoned connection can be removed.

See Also:
Constant Field Values

DBCP_LOGABANDONED

public static final String DBCP_LOGABANDONED
Default: false Flag to log stack traces for application code which abandoned a Statement or Connection. Logging of abandoned Statements and Connections adds overhead for every Connection open or new Statement because a stack trace has to be generated.

See Also:
Constant Field Values
Method Detail

instance

public static RDBConnectionManager instance()

finalize

protected void finalize()
Overrides:
finalize in class Object

getConnection

public Connection getConnection()
                         throws SQLException
Throws:
SQLException

printDriverStats

public static void printDriverStats()
                             throws Exception
Throws:
Exception

getNumLockedProcesses

public int getNumLockedProcesses()
getNumLockedProcesses - gets the number of currently locked processes on the MySQL db

Returns:
Number of locked processes


Copyright © 2013. All rights reserved.