OC4J Slowness / Hanging with OracleImplicitConnectionCache.retrieveCacheConnection Waiting for Lock

(Doc ID 1672120.1)

Last updated on NOVEMBER 05, 2016

Applies to:

Oracle Containers for J2EE - Version 10.1.3.5.0 and later
Information in this document applies to any platform.

Symptoms

OC4J is observed as slow. Taking a thread dump shows that a lot of threads are waiting like this:

"AJPRequestHandler-HTTPThreadGroup-250" prio=1 tid=0x00002aaad14bf930 nid=0x6184 waiting for monitor entry [0x0000000044dac000..0x0000000044dadb90]
    at oracle.jdbc.pool.OracleImplicitConnectionCache.retrieveCacheConnection(OracleImplicitConnectionCache.java:650)
    - waiting to lock <0x00002aac01e965f8> (a oracle.jdbc.pool.OracleImplicitConnectionCache)
    at oracle.jdbc.pool.OracleImplicitConnectionCache.getCacheConnection(OracleImplicitConnectionCache.java:548)
    at oracle.jdbc.pool.OracleImplicitConnectionCache.getConnection(OracleImplicitConnectionCache.java:429)
    at oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.java:433)
[...]
The lock that all of these threads are waiting for is held by:

"Thread-39" daemon prio=1 tid=0x00002aaaad9888e0 nid=0x50f5 waiting for monitor entry [0x0000000041ee2000..0x0000000041ee2e10]
    at oracle.jdbc.driver.PhysicalConnection.closeLogicalConnection(PhysicalConnection.java:1607)
    - waiting to lock <0x00002aac085deb80> (a oracle.jdbc.driver.T4CConnection)
    at oracle.jdbc.driver.LogicalConnection.cleanupAndClose(LogicalConnection.java:279)
    at oracle.jdbc.pool.OracleImplicitConnectionCache.closeCheckedOutConnection(OracleImplicitConnectionCache.java:1502)
    at oracle.jdbc.pool.OracleImplicitConnectionCacheThread.runAbandonedTimeout(OracleImplicitConnectionCacheThread.java:258)
    - locked <0x00002aac01e965f8> (a oracle.jdbc.pool.OracleImplicitConnectionCache)
    at oracle.jdbc.pool.OracleImplicitConnectionCacheThread.run(OracleImplicitConnectionCacheThread.java:81)

and that waits for a lock that is held by:

"AJPRequestHandler-HTTPThreadGroup-26" prio=1 tid=0x00002aaab6860340 nid=0x5097 runnable [0x00000000416c2000..0x00000000416c3e10]
    at java.net.SocketInputStream.socketRead0(Native Method)
    at java.net.SocketInputStream.read(SocketInputStream.java:129)
    at oracle.net.ns.Packet.receive(Unknown Source)
    at oracle.net.ns.DataPacket.receive(Unknown Source)
    at oracle.net.ns.NetInputStream.getNextPacket(Unknown Source)
    at oracle.net.ns.NetInputStream.read(Unknown Source)
    at oracle.jdbc.driver.T4CMAREngine.getNBytes(T4CMAREngine.java:1533)
    at oracle.jdbc.driver.T4CMAREngine.unmarshalNBytes(T4CMAREngine.java:1503)
    at oracle.jdbc.driver.T4CMAREngine.unmarshalBuffer(T4CMAREngine.java:2021)
    at oracle.jdbc.driver.T4CMAREngine.unmarshalCLR(T4CMAREngine.java:1896)
    at oracle.jdbc.driver.T4CMAREngine.unmarshalCLR(T4CMAREngine.java:1729)
    at oracle.jdbc.driver.T4CVarcharAccessor.unmarshalOneRow(T4CVarcharAccessor.java:193)
    at oracle.jdbc.driver.T4CTTIrxd.unmarshal(T4CTTIrxd.java:905)
    at oracle.jdbc.driver.T4CTTIrxd.unmarshal(T4CTTIrxd.java:843)
    at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:638)
    at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:219)
    at oracle.jdbc.driver.T4CPreparedStatement.fetch(T4CPreparedStatement.java:1044)
    at oracle.jdbc.driver.OracleResultSetImpl.close_or_fetch_from_next(OracleResultSetImpl.java:308)
    - locked <0x00002aac085deb80> (a oracle.jdbc.driver.T4CConnection)
    at oracle.jdbc.driver.OracleResultSetImpl.next(OracleResultSetImpl.java:213)
    - locked <0x00002aac4da57180> (a oracle.jdbc.driver.OracleResultSetImpl)
    at oracle.jdbc.rowset.OracleCachedRowSet.populate(OracleCachedRowSet.java:1245)
    - locked <0x00002aac190b1e80> (a oracle.jdbc.rowset.OracleCachedRowSet)
    at sun.reflect.GeneratedMethodAccessor112.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:592)
    at com.company.applicationcode.jdncinterfacingCachedRowSet.populate(CachedRowSet.java:36)
    at com.company.applicationcode.jdncinterfacing.CachedRowSet.getInstance(CachedRowSet.java:59)
[...]

(This is application code doing a JDBC database operation and waiting for network response from the database).

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