com.jdbaccess.db
Class StatementPool

java.lang.Object
  extended by com.jdbaccess.db.StatementPool

public class StatementPool
extends java.lang.Object


Field Summary
protected  java.util.Hashtable cachePool
           
protected  java.util.TreeMap cachePoolLRU
           
protected  int cachePoolSize
           
protected  ConnPool connPool
           
protected  boolean debugMode
           
protected  int maxCachePoolSize
           
protected  java.lang.String name
           
protected  QueryConnPool queryConnPool
           
protected  long stmtCounter
           
protected  java.util.Hashtable usePool
           
 
Constructor Summary
StatementPool(ConnPool connPool, QueryConnPool queryConnPool)
           
StatementPool(ConnPool connPool, QueryConnPool queryConnPool, int maxCachePoolSize)
           
 
Method Summary
 void deleteStatementsFromCachePoolsByTransaction(com.jdbaccess.daimpl.TransactionImpl t)
          all statements are removed from cache pools by transaction
 java.util.ArrayList deleteStatementsFromUsedPoolByTransaction(com.jdbaccess.daimpl.TransactionImpl t)
           
 void end()
          Close all statements in usePool and CachePool
 void end(com.jdbaccess.daimpl.DataAccessImpl da)
           
 void end(com.jdbaccess.daimpl.TransactionImpl t)
           
 Statement findStatement(int stmtId)
           
 int getStatement(com.jdbaccess.daimpl.DataAccessImpl da)
          get a new prepared statement out of pool
 boolean hasNetworkProblems()
           
 void ping(long appId)
           
 void releaseStatement(int stmtId)
          release statement back to pool
 void setCleanupInterval(long cleanupInterval)
           
 void setDebugModeOff()
           
static void setMaxStmtCount(long maxStmtCount)
           
 void setPingInterval(long pingInterval)
           
 void start()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

debugMode

protected boolean debugMode

connPool

protected ConnPool connPool

queryConnPool

protected QueryConnPool queryConnPool

name

protected java.lang.String name

maxCachePoolSize

protected int maxCachePoolSize

cachePool

protected java.util.Hashtable cachePool

cachePoolSize

protected int cachePoolSize

cachePoolLRU

protected java.util.TreeMap cachePoolLRU

usePool

protected java.util.Hashtable usePool

stmtCounter

protected long stmtCounter
Constructor Detail

StatementPool

public StatementPool(ConnPool connPool,
                     QueryConnPool queryConnPool)

StatementPool

public StatementPool(ConnPool connPool,
                     QueryConnPool queryConnPool,
                     int maxCachePoolSize)
Method Detail

setMaxStmtCount

public static void setMaxStmtCount(long maxStmtCount)

setDebugModeOff

public void setDebugModeOff()

start

public void start()
           throws ApplicationException
Throws:
ApplicationException

end

public void end()
         throws ApplicationException
Close all statements in usePool and CachePool

Throws:
java.sql.SQLException
ApplicationException

hasNetworkProblems

public boolean hasNetworkProblems()

getStatement

public int getStatement(com.jdbaccess.daimpl.DataAccessImpl da)
                 throws ApplicationException
get a new prepared statement out of pool

Returns:
a new statement id
Throws:
java.sql.SQLException
ApplicationException

findStatement

public Statement findStatement(int stmtId)
                        throws ApplicationException
Throws:
ApplicationException

releaseStatement

public void releaseStatement(int stmtId)
                      throws ApplicationException
release statement back to pool

Parameters:
stmtId -
Throws:
java.sql.SQLException
ApplicationException

end

public void end(com.jdbaccess.daimpl.TransactionImpl t)
         throws ApplicationException
Throws:
ApplicationException

end

public void end(com.jdbaccess.daimpl.DataAccessImpl da)
         throws ApplicationException
Throws:
ApplicationException

ping

public void ping(long appId)

setPingInterval

public void setPingInterval(long pingInterval)

setCleanupInterval

public void setCleanupInterval(long cleanupInterval)

deleteStatementsFromUsedPoolByTransaction

public java.util.ArrayList deleteStatementsFromUsedPoolByTransaction(com.jdbaccess.daimpl.TransactionImpl t)
                                                              throws ApplicationException
Throws:
ApplicationException

deleteStatementsFromCachePoolsByTransaction

public void deleteStatementsFromCachePoolsByTransaction(com.jdbaccess.daimpl.TransactionImpl t)
                                                 throws ApplicationException
all statements are removed from cache pools by transaction

Parameters:
t -
Throws:
ApplicationException