Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
public interface PooledDataSource
extends DataSource
Method Summary | |
void |
|
void |
|
Collection | |
String | |
float |
|
float | |
String | |
Throwable |
|
Throwable | |
Throwable |
|
Throwable | |
Throwable |
|
Throwable | |
Throwable |
|
Throwable | |
Throwable |
|
Throwable | |
int |
|
int |
|
int | |
int | |
int |
|
int |
|
int | |
int | |
long | |
long | |
long | |
int | |
int |
|
int |
|
int | |
int | |
int |
|
int | |
int |
|
int |
|
int | |
int | |
int | |
long | |
int |
|
int | |
int | |
int |
|
int | |
int | |
int |
|
int | |
int | |
int | |
int | |
int | |
int | |
long | |
void |
|
String |
|
String | |
String |
|
String | |
String |
|
String | |
String |
|
String | |
String |
|
String | |
String |
|
String | |
String | |
String | |
void |
|
void |
|
void |
|
void |
|
public void close() throws SQLException
C3P0 pooled DataSources use no resources before they are actually used in a VM, and they close themselves in their finalize() method. When they are active and pooling, they may have open database connections and their pool may spawn several threads for its maintenance. You can use this method to clean these resource methods up quickly when you will no longer be using this DataSource. The resources will actually be cleaned up only if no other DataSources are sharing the same pool. You can equivalently use the static method destroy() in the DataSources class to clean-up these resources. This is equivalent to calling close( false ).
- See Also:
DataSources.destroy(DataSource)
public void close(boolean force_destory) throws SQLException
Deprecated. the force_destroy argument is now meaningless, as pools are no longer potentially shared between multiple DataSources.
Should be used only with great caution. If force_destroy is set to true, this immediately destroys any pool and cleans up all resources this DataSource may be using, even if other DataSources are sharing that pool! In general, it is difficult to know whether a pool is being shared by multiple DataSources. It may depend upon whether or not a JNDI implementation returns a single instance or multiple copies upon lookup (which is undefined by the JNDI spec). In general, this method should be used only when you wish to wind down all c3p0 pools in a ClassLoader. For example, when shutting down and restarting a web application that uses c3p0, you may wish to kill all threads making use of classes loaded by a web-app specific ClassLoader, so that the ClassLoader can be cleanly garbage collected. In this case, you may wish to use force destroy. Otherwise, it is much safer to use the simple destroy() method, which will not shut down pools that may still be in use. To close a pool normally, use the no argument close method, or set force_destroy to false.
- See Also:
close()
public Collection getAllUsers() throws SQLException
public String getDataSourceName()
public float getEffectivePropertyCycle(String username, String password) throws SQLException
public float getEffectivePropertyCycleDefaultUser() throws SQLException
public String getIdentityToken()
public Throwable getLastAcquisitionFailure(String username, String password) throws SQLException
public Throwable getLastAcquisitionFailureDefaultUser() throws SQLException
public Throwable getLastCheckinFailure(String username, String password) throws SQLException
public Throwable getLastCheckinFailureDefaultUser() throws SQLException
public Throwable getLastCheckoutFailure(String username, String password) throws SQLException
public Throwable getLastCheckoutFailureDefaultUser() throws SQLException
public Throwable getLastConnectionTestFailure(String username, String password) throws SQLException
public Throwable getLastConnectionTestFailureDefaultUser() throws SQLException
public Throwable getLastIdleTestFailure(String username, String password) throws SQLException
public Throwable getLastIdleTestFailureDefaultUser() throws SQLException
public int getNumBusyConnections() throws SQLException
Deprecated. use getNumBusyConnectionsDefaultUser()
public int getNumBusyConnections(String username, String password) throws SQLException
public int getNumBusyConnectionsAllUsers() throws SQLException
public int getNumBusyConnectionsDefaultUser() throws SQLException
public int getNumConnections() throws SQLException
Deprecated. use getNumConnectionsDefaultUser()
public int getNumConnections(String username, String password) throws SQLException
public int getNumConnectionsAllUsers() throws SQLException
public int getNumConnectionsDefaultUser() throws SQLException
public long getNumFailedCheckinsDefaultUser() throws SQLException
public long getNumFailedCheckoutsDefaultUser() throws SQLException
public long getNumFailedIdleTestsDefaultUser() throws SQLException
public int getNumHelperThreads() throws SQLException
public int getNumIdleConnections() throws SQLException
Deprecated. use getNumIdleConnectionsDefaultUser()
public int getNumIdleConnections(String username, String password) throws SQLException
public int getNumIdleConnectionsAllUsers() throws SQLException
public int getNumIdleConnectionsDefaultUser() throws SQLException
public int getNumThreadsAwaitingCheckout(String username, String password) throws SQLException
public int getNumThreadsAwaitingCheckoutDefaultUser() throws SQLException
public int getNumUnclosedOrphanedConnections() throws SQLException
Deprecated. use getNumUnclosedOrphanedConnectionsDefaultUser()
public int getNumUnclosedOrphanedConnections(String username, String password) throws SQLException
public int getNumUnclosedOrphanedConnectionsAllUsers() throws SQLException
public int getNumUnclosedOrphanedConnectionsDefaultUser() throws SQLException
public int getNumUserPools() throws SQLException
public long getStartTimeMillisDefaultUser() throws SQLException
public int getStatementCacheNumCheckedOut(String username, String password) throws SQLException
public int getStatementCacheNumCheckedOutDefaultUser() throws SQLException
public int getStatementCacheNumCheckedOutStatementsAllUsers() throws SQLException
public int getStatementCacheNumConnectionsWithCachedStatements(String username, String password) throws SQLException
public int getStatementCacheNumConnectionsWithCachedStatementsAllUsers() throws SQLException
public int getStatementCacheNumConnectionsWithCachedStatementsDefaultUser() throws SQLException
public int getStatementCacheNumStatements(String username, String password) throws SQLException
public int getStatementCacheNumStatementsAllUsers() throws SQLException
public int getStatementCacheNumStatementsDefaultUser() throws SQLException
public int getThreadPoolNumActiveThreads() throws SQLException
public int getThreadPoolNumIdleThreads() throws SQLException
public int getThreadPoolNumTasksPending() throws SQLException
public int getThreadPoolSize() throws SQLException
public long getUpTimeMillisDefaultUser() throws SQLException
public void hardReset() throws SQLException
Destroys all pooled and checked-out Connections associated with this DataSource immediately. The PooledDataSource is reset to its initial state prior to first Connection acquisition, with no pools yet active, but ready for requests.
public String sampleLastAcquisitionFailureStackTrace(String username, String password) throws SQLException
public String sampleLastAcquisitionFailureStackTraceDefaultUser() throws SQLException
public String sampleLastCheckinFailureStackTrace(String username, String password) throws SQLException
public String sampleLastCheckinFailureStackTraceDefaultUser() throws SQLException
public String sampleLastCheckoutFailureStackTrace(String username, String password) throws SQLException
public String sampleLastCheckoutFailureStackTraceDefaultUser() throws SQLException
public String sampleLastConnectionTestFailureStackTrace(String username, String password) throws SQLException
public String sampleLastConnectionTestFailureStackTraceDefaultUser() throws SQLException
public String sampleLastIdleTestFailureStackTrace(String username, String password) throws SQLException
public String sampleLastIdleTestFailureStackTraceDefaultUser() throws SQLException
public String sampleStatementCacheStatus(String username, String password) throws SQLException
public String sampleStatementCacheStatusDefaultUser() throws SQLException
public String sampleThreadPoolStackTraces() throws SQLException
public String sampleThreadPoolStatus() throws SQLException
public void setDataSourceName(String dataSourceName)
public void softReset(String username, String password) throws SQLException
Discards all Connections managed by the PooledDataSource with the specified authentication credentials and reacquires new Connections to populate. Current checked out Connections will still be valid, and should still be checked into the PooledDataSource (so the PooledDataSource can destroy them).
public void softResetAllUsers() throws SQLException
Discards all Connections managed by the PooledDataSource and reacquires new Connections to populate. Current checked out Connections will still be valid, and should still be checked into the PooledDataSource (so the PooledDataSource can destroy them).
public void softResetDefaultUser() throws SQLException
Discards all Connections managed by the PooledDataSource's default-authentication pool and reacquires new Connections to populate. Current checked out Connections will still be valid, and should still be checked into the PooledDataSource (so the PooledDataSource can destroy them).