Package com.mchange.v2.c3p0.stmt
Class GooGooStatementCache
- java.lang.Object
-
- com.mchange.v2.c3p0.stmt.GooGooStatementCache
-
- Direct Known Subclasses:
DoubleMaxStatementCache,GlobalMaxOnlyStatementCache,PerConnectionMaxOnlyStatementCache
public abstract class GooGooStatementCache extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classGooGooStatementCache.ConnectionStatementManagerprotected classGooGooStatementCache.Deathmarchprotected classGooGooStatementCache.DeathmarchConnectionStatementManagerprotected static classGooGooStatementCache.SimpleConnectionStatementManager
-
Constructor Summary
Constructors Constructor Description GooGooStatementCache(com.mchange.v2.async.AsynchronousRunner blockingTaskAsyncRunner, com.mchange.v2.async.AsynchronousRunner deferredStatementDestroyer, boolean cancelAutomaticallyClosedStatements)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcheckinAll(java.sql.Connection pcon)voidcheckinStatement(java.lang.Object pstmt)java.lang.ObjectcheckoutStatement(java.sql.Connection physicalConnection, java.lang.reflect.Method stmtProducingMethod, java.lang.Object[] args)java.lang.ObjectcheckoutStatement(java.sql.Connection physicalConnection, java.lang.reflect.Method stmtProducingMethod, java.lang.Object[] args, boolean[] actuallyCachedHolder)voidclose()voidcloseAll(java.sql.Connection pcon)java.lang.StringdumpStatementCacheStatus()intgetNumConnectionsWithCachedStatements()intgetNumStatements()intgetNumStatementsCheckedOut()intgetStatementDestroyerNumConnectionsInUse()intgetStatementDestroyerNumConnectionsWithDeferredDestroyStatements()intgetStatementDestroyerNumDeferredDestroyStatements()java.lang.BooleaninUse(java.sql.Connection physicalConnection)booleanisClosed()booleantryMarkConnectionInUse(java.sql.Connection physicalConnection)voidunmarkConnectionInUse(java.sql.Connection physicalConnection)voidwaitMarkConnectionInUse(java.sql.Connection physicalConnection)
-
-
-
Method Detail
-
getNumStatements
public int getNumStatements()
-
getNumStatementsCheckedOut
public int getNumStatementsCheckedOut()
-
getNumConnectionsWithCachedStatements
public int getNumConnectionsWithCachedStatements()
-
dumpStatementCacheStatus
public java.lang.String dumpStatementCacheStatus()
-
waitMarkConnectionInUse
public void waitMarkConnectionInUse(java.sql.Connection physicalConnection) throws java.lang.InterruptedException- Throws:
java.lang.InterruptedException
-
tryMarkConnectionInUse
public boolean tryMarkConnectionInUse(java.sql.Connection physicalConnection)
-
unmarkConnectionInUse
public void unmarkConnectionInUse(java.sql.Connection physicalConnection)
-
inUse
public java.lang.Boolean inUse(java.sql.Connection physicalConnection)
-
getStatementDestroyerNumConnectionsInUse
public int getStatementDestroyerNumConnectionsInUse()
-
getStatementDestroyerNumConnectionsWithDeferredDestroyStatements
public int getStatementDestroyerNumConnectionsWithDeferredDestroyStatements()
-
getStatementDestroyerNumDeferredDestroyStatements
public int getStatementDestroyerNumDeferredDestroyStatements()
-
checkoutStatement
public java.lang.Object checkoutStatement(java.sql.Connection physicalConnection, java.lang.reflect.Method stmtProducingMethod, java.lang.Object[] args) throws java.sql.SQLException, com.mchange.v2.util.ResourceClosedException- Throws:
java.sql.SQLExceptioncom.mchange.v2.util.ResourceClosedException
-
checkoutStatement
public java.lang.Object checkoutStatement(java.sql.Connection physicalConnection, java.lang.reflect.Method stmtProducingMethod, java.lang.Object[] args, boolean[] actuallyCachedHolder) throws java.sql.SQLException, com.mchange.v2.util.ResourceClosedException- Parameters:
actuallyCachedHolder- if non-null, set to whether the returned Statement was taken into the cache. Two things can prevent that. The cache may be unable to make room, in which case the Statement is an "overload Statement"; or the Statement may be one this cache already holds, handed back to us by a driver-side Statement cache, in which case we disown our copy rather than cache it twice. Either way the cache does not track the Statement, and will simply destroy it if it is ever checked in. Callers that ensure abandoned Statements get close()ed when their parent Connection is checked in need to know this, so that they can take responsibility for what we declined to keep.- Throws:
java.sql.SQLExceptioncom.mchange.v2.util.ResourceClosedException
-
checkinStatement
public void checkinStatement(java.lang.Object pstmt) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
checkinAll
public void checkinAll(java.sql.Connection pcon) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
closeAll
public void closeAll(java.sql.Connection pcon) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
close
public void close() throws java.sql.SQLException- Throws:
java.sql.SQLException
-
isClosed
public boolean isClosed()
-
-