Freezing and unfreezing the statement pool
- Last Updated: June 13, 2019
- 1 minute read
- DataDirect Connectors
- JDBC
- Aha! 6.0
- Amazon Redshift 6.0
- Apache Cassandra 6.0
- Apache Hive 6.0
- Apache Spark SQL 6.0
- Atlassian Jira 6.0
- Autonomous REST Connector 6.0
- Cloudera Impala 5.1
- + 24
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.