Serious deadlock problem
gorano Nov 6, 2003 12:19 PMWe have a serious deadlock problem using JMs and MDBs.
Before we push a message on to the queue we do a precheck if the status in the MTGroup entity is ok. We get the MTgroups from another entity using CMR and many to many. All of this happens in our session facade (stateless session bean):
for (Iterator i=sd.getMTGroups().iterator(); i.hasNext();) {
MTGroupLocal mtg = (MTGroupLocal) i.next();
if (Global.STATUS.ACTIVE == mtg.getStatusId() && mtGroup == mtg.getId().intValue()) {
return true;
}
}
return false;
The MDBs consume the messages and are doing a lookup on the same entity (MTGroup) as the precheck. We get the following error:
18:11:54,618 ERROR [STDERR] javax.ejb.EJBException: null; CausedByException is:
Application deadlock detected, resource=org.jboss.ejb.plugins.lock.QueuedPessimisticEJBLock@2baf77, bean=com_afl_srmp_entity_ServiceDetail, id=1, refs=3, tx=TransactionImpl:XidImpl [FormatId=257, GlobalId=8246CCFZ10S6//30407, BranchQual=], synched=Thread[RMI TCP Connection(25)-10.1.230.196,5,RMI Runtime], timeout=5000, queue=[TXLOCK waitingTx=TransactionImpl:XidImpl [FormatId=257, GlobalId=8246CCFZ10S6//30441, BranchQual=] id=0 thread=Thread[RMI TCP Connection(29)-10.1.230.196,5,RMI Runtime] queued=true], holder=TransactionImpl:XidImpl [FormatId=257, GlobalId=8246CCFZ10S6//30465, BranchQual=], waitingResource=org.jboss.ejb.plugins.lock.QueuedPessimisticEJBLock@cc863, bean=com_afl_srmp_entity_MTGroup, id=1, refs=2, tx=TransactionImpl:XidImpl [FormatId=257, GlobalId=8246CCFZ10S6//30331, BranchQual=], synched=null, timeout=5000, queue=[TXLOCK waitingTx=TransactionImpl:XidImpl [FormatId=257, GlobalId=8246CCFZ10S6//30407, BranchQual=] id=0 thread=Thread[RMI TCP Connection(28)-10.1.230.196,5,RMI Runtime] queued=true], waitingResourceHolder=TransactionImpl:XidImpl [FormatId=257, GlobalId=8246CCFZ10S6//30331, BranchQual=]
any ideas and recommendations?
We are pushing a high load onto the queue using 5 threads (all doing the precheck involving the MTGroup entity)
Thanks
Goran