Details
-
Bug
-
Status: Closed
-
Critical
-
Resolution: Fixed
-
3.0, 3.0.1
-
None
-
Linux
Description
I'm using cayenne 3.0 ans I'm experiencing a deadlock when I exit my application. I call PoolManager.dispose() to disconnect all connections, but it seems if at the same time a pooled connection is returned to the pool then it deadlocks.
Here is the deadlock as detected by the java console.
Name: Worker-2
State: BLOCKED on com.sma.core.net.OpconPoolManager@197871d owned by: main
Total blocked: 327 Total waited: 475
Stack trace:
org.apache.cayenne.conn.PoolManager.connectionClosed(PoolManager.java:438)
org.apache.cayenne.conn.PooledConnectionImpl.connectionClosedNotification(PooledConnectionImpl.java:181)
- locked java.util.Collections$SynchronizedRandomAccessList@12a12fc
org.apache.cayenne.conn.PooledConnectionImpl.returnConnectionToThePool(PooledConnectionImpl.java:146)
org.apache.cayenne.conn.ConnectionWrapper.close(ConnectionWrapper.java:127)
org.apache.cayenne.access.ExternalTransaction.close(ExternalTransaction.java:168)
org.apache.cayenne.access.ExternalTransaction.commit(ExternalTransaction.java:105)
_______________________________________________________________________________________________________
Name: main
State: BLOCKED on java.util.Collections$SynchronizedRandomAccessList@12a12fc owned by: Worker-2
Total blocked: 30 Total waited: 122
Stack trace:
org.apache.cayenne.conn.PooledConnectionImpl.removeConnectionEventListener(PooledConnectionImpl.java:97)
org.apache.cayenne.conn.PoolManager.dispose(OpconPoolManager.java:169)
- locked org.apache.cayenne.conn.PoolManager@197871d
com.sma.core.session.Session.disconnect(Session.java:189) - locked java.lang.Object@167a300
com.sma.core.session.Session.logout(Session.java:269) - locked java.lang.Object@167a300