|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--velosurf.sql.PreparedStatementPool
This class is a pool of PooledPreparedStatements
Field Summary | |
protected java.lang.Thread |
mCheckTimeoutThread
running thread |
protected int |
mCount
statements count |
protected DBConnection |
mDBConnection
database connection |
protected boolean |
mRunning
true if running |
protected java.lang.Object |
mSemaphore
semaphore |
protected HashMultiMap |
mStatementsMap
map queries -> statements |
protected static long |
sCheckDelay
check delay |
protected static int |
sMaxStatements
max number of statements |
protected static long |
sTimeout
after this timeout, statements are recycled even if not closed |
Constructor Summary | |
protected |
PreparedStatementPool(DBConnection inDBConnection)
builds a new pool |
Method Summary | |
void |
clear()
close all statements |
protected void |
finalize()
clear statements on exit |
protected PooledPreparedStatement |
getPreparedStatement(java.lang.String inQuery)
gets a PooledPreparedStatement associated with this query |
protected PooledPreparedStatement |
getTransactionPreparedStatement(java.lang.String inQuery)
get a statement that is going to be used in transactions |
protected int[] |
getUsageStats()
debug - get usage statistics |
void |
run()
cycle through statements to check and recycle them |
Methods inherited from class java.lang.Object |
|
Field Detail |
protected DBConnection mDBConnection
protected int mCount
protected HashMultiMap mStatementsMap
protected java.lang.Thread mCheckTimeoutThread
protected boolean mRunning
protected java.lang.Object mSemaphore
protected static long sCheckDelay
protected static long sTimeout
protected static int sMaxStatements
Constructor Detail |
protected PreparedStatementPool(DBConnection inDBConnection)
inDBConnection
- database connectionMethod Detail |
protected PooledPreparedStatement getPreparedStatement(java.lang.String inQuery) throws java.sql.SQLException
inQuery
- an SQL queryjava.sql.SQLException
- thrown by the database engineprotected PooledPreparedStatement getTransactionPreparedStatement(java.lang.String inQuery) throws java.sql.SQLException
inQuery
- an SQL queryjava.sql.SQLException
- thrown by the database enginepublic void run()
run
in interface java.lang.Runnable
public void clear()
protected void finalize()
finalize
in class java.lang.Object
protected int[] getUsageStats()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |