My Oracle Support Banner

Abandoned Connection Timeout Events Occurring Repeatedly And Connection Not Reclaimed by The Connection Cache When Invoking handleAbandonedConnection Method in JDBC 11.2 (Doc ID 1542696.1)

Last updated on AUGUST 30, 2023

Applies to:

JDBC - Version to [Release 11.2]
Information in this document applies to any platform.


Application uses the Implicit Connection Cache feature with JDBC driver

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 version of ojdbc6.jar to the version in a recent application upgrade.
Testing shows that the abandoned connection timeout handling works as documented in JDBC driver but not in any version of JDBC 11.2.


 Upgrade from JDBC driver to JDBC driver


To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!

In this Document

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.