Removing connections from a pool
- Last Updated: October 7, 2020
- 1 minute read
- DataDirect Connectors
- ODBC
- Aha! 8.0
- Amazon Redshift 8.0
- Apache Cassandra 8.0
- Apache Hive 8.0
- Apache Spark SQL 8.0
- Autonomous Rest Connector 8.0
- Cloudera Impala 7.1
- dBase 7.1
- + 24
A connection is removed from a connection pool when it exceeds its lifetime as determined by the Load Balance Timeout connection option. In addition, DataDirect has created connection attributes described in the following table to give your application the ability to reset connection pools. If connections are in use at the time of these calls, they are marked appropriately. When SQLDisconnect is called, the connections are discarded instead of being returned to the pool.
| Connection Attribute | Description |
|---|---|
| SQL_ATTR_CLEAR_POOLS Value: SQL_CLEAR_ALL_CONN_POOL | Calling SQLSetConnectAttr (SQL_ATTR_CLEAR_POOLS, SQL_CLEAR_ALL_CONN_POOL) clears all the connection pools associated with the driver that created the connection.This is a write-only connection attribute. The driver returns an error if SQLGetConnectAttr (SQL_ATTR_CLEAR_POOLS) is called. |
| SQL_ATTR_CLEAR_POOLS Value: SQL_CLEAR_CURRENT_CONN_POOL | Calling SQLSetConnectAttr (SQL_ATTR_CLEAR_POOLS, SQL_CLEAR_CURRENT_CONN_POOL) clears the connection pool that is associated with the current connection.This is a write-only connection attribute. The driver returns an error if SQLGetConnectAttr (SQL_ATTR_CLEAR_POOLS) is called. |
Note: By default, if removing a connection causes the number of
connections to drop below the number specified in the Min Pool Size option, a new connection
is not created until an application needs one.