2 Replies Latest reply on Dec 26, 2005 6:53 AM by ereze

    QueuedPessimisticEJBLock not releasing lock on read-only met

    mjtodd

      I have been experiencing problems where the deadlock detector was detecting deadlock after a series of calls on read-only methods. It is my understanding that when calling a sequence of entirely read-only methods that deadlock should not occur.
      I have looked at the code for QueuedPessimisticEJBLock and the comment at the top indiciates that for read-only method the lock is released at the end of the invocation. This does not seem to be the case. I have made the following modification to the code of endInvocation:

      if (ctx == null || ctx.hasTxSynchronization() == false)
       endTransaction(tx);


      I changed to

      if (ctx == null || ctx.hasTxSynchronization() == false || isReadOnlyTxLock)
       endTransaction(tx);


      Is this a valid code change to fix the issue, or have I not fully understood the code? Without my change then isReadOnlyTxLock is never used.