#12 Lock failure when removing review report

Server
closed-fixed
nobody
6
2009-05-20
2007-04-05
Emil Conde
No

There was some work being done by a user, when the billing process started and had to remove the existing review to regenerate it. A deadlock happened with this stack trace:

2007-04-05 01:00:01,505 DEBUG [com.sapienter.jbilling.server.process.BillingProcessSessionBean] Processing (1) entity XXX total = X
2007-04-05 01:00:01,514 DEBUG [com.sapienter.jbilling.server.process.BillingProcessSessionBean] No run scheduled
2007-04-05 01:00:01,517 DEBUG [com.sapienter.jbilling.server.process.BillingProcessSessionBean] Review disapproved. Regeneratting.
2007-04-05 01:00:01,517 DEBUG [com.sapienter.jbilling.server.process.BillingProcessSessionBean] Generating review entity XXX
2007-04-05 01:00:01,541 DEBUG [com.sapienter.jbilling.server.process.BillingProcessBL] Removing review id = 2813 from entity XXX
2007-04-05 01:00:04,252 DEBUG [com.sapienter.jbilling.server.pluggableTask.PluggableTaskManager] Applying task com.sapienter.jbilling.server.pluggableTask.PaperInvoiceNotificationTask
2007-04-05 01:00:04,254 DEBUG [com.sapienter.jbilling.server.util.SequenceSessionBean] table notification_message_arch current 84818 last: 84821
2007-04-05 01:00:04,256 DEBUG [com.sapienter.jbilling.server.util.SequenceSessionBean] Returning PK for notification_message_arch 84819
2007-04-05 01:00:04,261 DEBUG [com.sapienter.jbilling.server.util.SequenceSessionBean] table notification_message_arch_line current 220404 last: 220406
2007-04-05 01:00:04,263 DEBUG [com.sapienter.jbilling.server.util.SequenceSessionBean] Returning PK for notification_message_arch_line 220405
2007-04-05 01:00:04,266 DEBUG [com.sapienter.jbilling.server.util.SequenceSessionBean] table notification_message_arch_line current 220405 last: 220406
2007-04-05 01:00:04,267 DEBUG [com.sapienter.jbilling.server.util.SequenceSessionBean] Looking for new block
2007-04-05 01:00:04,267 DEBUG [com.sapienter.jbilling.server.util.SequenceSessionBean] Got new block for notification_message_arch_line Now id = 220406
2007-04-05 01:00:04,949 DEBUG [com.sapienter.jbilling.server.util.SequenceSessionBean] Returning PK for notification_message_arch_line 220406
2007-04-05 01:00:04,953 DEBUG [com.sapienter.jbilling.server.util.SequenceSessionBean] Returning PK for notification_message_arch_line 220407
2007-04-05 01:00:27,826 ERROR [com.sapienter.jbilling.server.process.BillingProcessSessionBean] Error processing entity XXX
javax.ejb.TransactionRolledbackLocalException: Application deadlock detected, resource=org.jboss.ejb.plugins.lock.QueuedPessimisticEJBLock@1eca35, bean=UserEntity, id=6795, refs=2, tx=TransactionImpl:XidImpl [FormatId=257, GlobalId=216-55-165-2.dedicated.abac.net//495282, BranchQual=], synched=Thread[DefaultQuartzScheduler_Worker-5,5,jboss], timeout=5000, queue=[], holder=TransactionImpl:XidImpl [FormatId=257, GlobalId=216-55-165-2.dedicated.abac.net//495281, BranchQual=], waitingResource=org.jboss.ejb.plugins.lock.QueuedPessimisticEJBLock@16d981b, bean=OrderEntity, id=11563, refs=2, tx=TransactionImpl:XidImpl [FormatId=257, GlobalId=216-55-165-2.dedicated.abac.net//495281, BranchQual=], synched=null, timeout=5000, queue=[TXLOCK waitingTx=TransactionImpl:XidImpl [FormatId=257, GlobalId=216-55-165-2.dedicated.abac.net//495282, BranchQual=] id=0 thread=Thread[http-0.0.0.0-443-Processor2,5,jboss] queued=true], waitingResourceHolder=TransactionImpl:XidImpl [FormatId=257, GlobalId=216-55-165-2.dedicated.abac.net//495281, BranchQual=]; CausedByException is:
Application deadlock detected, resource=org.jboss.ejb.plugins.lock.QueuedPessimisticEJBLock@1eca35, bean=UserEntity, id=6795, refs=2, tx=TransactionImpl:XidImpl [FormatId=257, GlobalId=216-55-165-2.dedicated.abac.net//495282, BranchQual=], synched=Thread[DefaultQuartzScheduler_Worker-5,5,jboss], timeout=5000, queue=[], holder=TransactionImpl:XidImpl [FormatId=257, GlobalId=216-55-165-2.dedicated.abac.net//495281, BranchQual=], waitingResource=org.jboss.ejb.plugins.lock.QueuedPessimisticEJBLock@16d981b, bean=OrderEntity, id=11563, refs=2, tx=TransactionImpl:XidImpl [FormatId=257, GlobalId=216-55-165-2.dedicated.abac.net//495281, BranchQual=], synched=null, timeout=5000, queue=[TXLOCK waitingTx=TransactionImpl:XidImpl [FormatId=257, GlobalId=216-55-165-2.dedicated.abac.net//495282, BranchQual=] id=0 thread=Thread[http-0.0.0.0-443-Processor2,5,jboss] queued=true], waitingResourceHolder=TransactionImpl:XidImpl [FormatId=257, GlobalId=216-55-165-2.dedicated.abac.net//495281, BranchQual=]
at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:204)

If triggered later, the process went well, with a new reivew generated.

Discussion

  • Emil Conde
    Emil Conde
    2009-05-20

    • status: open --> closed-fixed
     
  • Emil Conde
    Emil Conde
    2009-05-20

    No more pessimistic locking with hibernate.