Is this behavior explicitly by design or a bug?
When we upgraded oracle jar from 11.2.0.3.0 to Oracle JDBC jar 21.5 (ojdbc8.jar 21.5.0.0) , 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 .