| Prev Class | Next Class | Frames | No Frames |
| Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
public interface PooledDataSourceextends DataSourceMethod 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 SQLExceptionC3P0 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 SQLExceptionDeprecated. 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 SQLExceptionpublic String getDataSourceName()
public float getEffectivePropertyCycle(String username,
String password)
throws SQLExceptionpublic float getEffectivePropertyCycleDefaultUser()
throws SQLExceptionpublic String getIdentityToken()
public Throwable getLastAcquisitionFailure(String username,
String password)
throws SQLExceptionpublic Throwable getLastAcquisitionFailureDefaultUser()
throws SQLExceptionpublic Throwable getLastCheckinFailure(String username,
String password)
throws SQLExceptionpublic Throwable getLastCheckinFailureDefaultUser()
throws SQLExceptionpublic Throwable getLastCheckoutFailure(String username,
String password)
throws SQLExceptionpublic Throwable getLastCheckoutFailureDefaultUser()
throws SQLExceptionpublic Throwable getLastConnectionTestFailure(String username,
String password)
throws SQLExceptionpublic Throwable getLastConnectionTestFailureDefaultUser()
throws SQLExceptionpublic Throwable getLastIdleTestFailure(String username,
String password)
throws SQLExceptionpublic Throwable getLastIdleTestFailureDefaultUser()
throws SQLExceptionpublic int getNumBusyConnections()
throws SQLExceptionDeprecated. use getNumBusyConnectionsDefaultUser()
public int getNumBusyConnections(String username,
String password)
throws SQLExceptionpublic int getNumBusyConnectionsAllUsers()
throws SQLExceptionpublic int getNumBusyConnectionsDefaultUser()
throws SQLExceptionpublic int getNumConnections()
throws SQLExceptionDeprecated. use getNumConnectionsDefaultUser()
public int getNumConnections(String username,
String password)
throws SQLExceptionpublic int getNumConnectionsAllUsers()
throws SQLExceptionpublic int getNumConnectionsDefaultUser()
throws SQLExceptionpublic long getNumFailedCheckinsDefaultUser()
throws SQLExceptionpublic long getNumFailedCheckoutsDefaultUser()
throws SQLExceptionpublic long getNumFailedIdleTestsDefaultUser()
throws SQLExceptionpublic int getNumHelperThreads()
throws SQLExceptionpublic int getNumIdleConnections()
throws SQLExceptionDeprecated. use getNumIdleConnectionsDefaultUser()
public int getNumIdleConnections(String username,
String password)
throws SQLExceptionpublic int getNumIdleConnectionsAllUsers()
throws SQLExceptionpublic int getNumIdleConnectionsDefaultUser()
throws SQLExceptionpublic int getNumThreadsAwaitingCheckout(String username,
String password)
throws SQLExceptionpublic int getNumThreadsAwaitingCheckoutDefaultUser()
throws SQLExceptionpublic int getNumUnclosedOrphanedConnections()
throws SQLExceptionDeprecated. use getNumUnclosedOrphanedConnectionsDefaultUser()
public int getNumUnclosedOrphanedConnections(String username,
String password)
throws SQLExceptionpublic int getNumUnclosedOrphanedConnectionsAllUsers()
throws SQLExceptionpublic int getNumUnclosedOrphanedConnectionsDefaultUser()
throws SQLExceptionpublic int getNumUserPools()
throws SQLExceptionpublic long getStartTimeMillisDefaultUser()
throws SQLExceptionpublic int getStatementCacheNumCheckedOut(String username,
String password)
throws SQLExceptionpublic int getStatementCacheNumCheckedOutDefaultUser()
throws SQLExceptionpublic int getStatementCacheNumCheckedOutStatementsAllUsers()
throws SQLExceptionpublic int getStatementCacheNumConnectionsWithCachedStatements(String username,
String password)
throws SQLExceptionpublic int getStatementCacheNumConnectionsWithCachedStatementsAllUsers()
throws SQLExceptionpublic int getStatementCacheNumConnectionsWithCachedStatementsDefaultUser()
throws SQLExceptionpublic int getStatementCacheNumStatements(String username,
String password)
throws SQLExceptionpublic int getStatementCacheNumStatementsAllUsers()
throws SQLExceptionpublic int getStatementCacheNumStatementsDefaultUser()
throws SQLExceptionpublic int getThreadPoolNumActiveThreads()
throws SQLExceptionpublic int getThreadPoolNumIdleThreads()
throws SQLExceptionpublic int getThreadPoolNumTasksPending()
throws SQLExceptionpublic int getThreadPoolSize()
throws SQLExceptionpublic long getUpTimeMillisDefaultUser()
throws SQLExceptionpublic void hardReset()
throws SQLExceptionDestroys 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 SQLExceptionpublic String sampleLastAcquisitionFailureStackTraceDefaultUser()
throws SQLExceptionpublic String sampleLastCheckinFailureStackTrace(String username,
String password)
throws SQLExceptionpublic String sampleLastCheckinFailureStackTraceDefaultUser()
throws SQLExceptionpublic String sampleLastCheckoutFailureStackTrace(String username,
String password)
throws SQLExceptionpublic String sampleLastCheckoutFailureStackTraceDefaultUser()
throws SQLExceptionpublic String sampleLastConnectionTestFailureStackTrace(String username,
String password)
throws SQLExceptionpublic String sampleLastConnectionTestFailureStackTraceDefaultUser()
throws SQLExceptionpublic String sampleLastIdleTestFailureStackTrace(String username,
String password)
throws SQLExceptionpublic String sampleLastIdleTestFailureStackTraceDefaultUser()
throws SQLExceptionpublic String sampleStatementCacheStatus(String username,
String password)
throws SQLExceptionpublic String sampleStatementCacheStatusDefaultUser()
throws SQLExceptionpublic String sampleThreadPoolStackTraces()
throws SQLExceptionpublic String sampleThreadPoolStatus()
throws SQLExceptionpublic void setDataSourceName(String dataSourceName)
public void softReset(String username,
String password)
throws SQLExceptionDiscards 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 SQLExceptionDiscards 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 SQLExceptionDiscards 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).