Removing connections from a pool
- Last Updated: October 28, 2020
- 1 minute read
- DataDirect Connectors
- ODBC
- Oracle Database Wire Protocol 8.0
- Documentation
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.