Abandoned Connection Timeout Events Occurring Repeatedly And Connection Not Reclaimed by The Connection Cache When Invoking handleAbandonedConnection Method in JDBC 11.2
Last updated on MARCH 08, 2017
Applies to:JDBC - Version 22.214.171.124.0 to 126.96.36.199.0 [Release 11.2]
Information in this document applies to any platform.
Application uses the Implicit Connection Cache feature with JDBC driver 188.8.131.52.
Oracle® Database JDBC Developer's Guide, 11g Release 2 (11.2)
21 Implicit Connection Caching
states the following about Connection Cache Callbacks offered by the Implicit Connection cache feature:
The implicit connection cache offers a way for the application to specify callbacks to be called by the connection cache. Callback methods are supported with the
OracleConnectionCacheCallback interface. This callback mechanism is useful to take advantage of the special knowledge of the application about particular connections, supplementing the default behavior when handling abandoned connections or when the cache is empty.
An application can register a ConnectionCacheCallback on an OracleConnection. When a callback is registered, the connection cache calls the handleAbandonedConnection method of the callback before reclaiming the connection. If the callback returns true, then the connection is reclaimed. If the callback returns false, then the connection remains active.
Based on this, the Abandoned Connection Timeout functionality of the Implicit Connection Caching feature should invoke defined OracleConnectionCacheCallback class and specifically the handleAbandonedConnection method, which when returning true, the connection should then be reclaimed by the connection cache. This does not happen, and instead the Abandoned Connection Timeout callback is called again and again for the same connection until the application is terminated.
This behavior was discovered when moving from 184.108.40.206 version of ojdbc6.jar to the 220.127.116.11 version in a recent application upgrade.
Testing shows that the abandoned connection timeout handling works as documented in JDBC driver 18.104.22.168 but not in any version of JDBC 11.2.
Upgrade from JDBC driver 22.214.171.124 to JDBC driver 126.96.36.199.
Sign In with your My Oracle Support account
Don't have a My Oracle Support account? Click to get started
My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms