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 MARCH 08, 2017

Applies to:

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

Symptoms

Application uses the Implicit Connection Cache feature with JDBC driver 11.2.0.3.

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

Changes

 Upgrade from JDBC driver 11.1.0.6 to JDBC driver 11.2.0.3.

Cause

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