skip to main content
DataDirect tools : Statement Pool Monitor : Freezing and unfreezing the statement pool
  

Try DataDirect Drivers Now

Freezing and unfreezing the statement pool

Freezing the statement pool restricts the statements in the pool to those that were in the pool at the time the pool was frozen. For example, perhaps you have a core set of statements that you do not want replaced by new statements when your core statements are closed. You can freeze the pool using the setFrozen() method:
ExtStatementPoolMonitor monitor =
   ((ExtConnection) con).getStatementPoolMonitor().setFrozen(true);
Similarly, you can use the same method to unfreeze the statement pool:
ExtStatementPoolMonitor monitor =
   ((ExtConnection) con).getStatementPoolMonitor().setFrozen(false);
When the statement pool is frozen, your application can still clear the pool and import statements into the pool. In addition, you can use the Statement.setPoolable() method to add or remove single statements from the pool regardless of the pool’s frozen state, assuming the pool is not full. If the pool is frozen and the number of statements in the pool is the maximum, no statements can be added to the pool.
To determine if a pool is frozen, use the isFrozen() method.