I have run the java systests with the JCarder agent attached. JCarder detected a potential deadlock when the following are done concurrently:
- Application thread closes a connection
- A MessageListener creates a new session on that connection inside onMessage().
Here is a sketch of the wrongly-ordered locking:
I've attached JCarder's GraphViz-format .dot file which represents this slightly more comprehensively.