Skip to Main Content

Java Database Connectivity (JDBC)


For appeals, questions and feedback, please email

Bug in OracleImplicitConnectionCache for ojdbc8.jar

User_CJ60AFeb 17 2023

Is this behavior explicitly by design or a bug?

When we upgraded oracle jar from to Oracle JDBC jar 21.5 (ojdbc8.jar , we saw difference in session and connection handling. When connections are not closed properly , the inactive sessions piled up and the DB crashed. We did not see this issue in ojdbc6.jar.

In oracle 6 we have the class OracleImplicitConnectionCache , in this we have the below code where the inactive sessions are removed based on a configuration for time.

private void processInactivityTimeout(OraclePooledConnection paramOraclePooledConnection) throws SQLException { long l1 = paramOraclePooledConnection.getLastAccessedTime(); long l2 = System.currentTimeMillis(); if ((getTotalCachedConnections() > cacheMinLimit) && (l2 - l1 > cacheInactivityTimeout * 1000)) { closeAndRemovePooledConnection(paramOraclePooledConnection); } }

In oracle 6, when the connection is inactive for more than the value in getLastAccessedTime , the connections are removed from the pool. However, in oracle8 this class(OracleImplicitConnectionCache) is removed . We found no reference to any method or class which does this auto removal of inactive sessions .

Post Details
Added on Feb 17 2023