4 Replies Latest reply on Jun 25, 2003 4:06 PM by citrosoft

    Weird re-entrancy/deadlocking problem

    F Zemen Newbie

      I was seeing some deadlocking issues that I couldn't explain (3.0.5), JDK 1.4.1_02, Solaris & XP, Oracle 8 under light to moderate load.

      Fortunately, they were on read only type methods, so I changed those methods to read only and took them out of transactions (I had to turn off row locking for that because of Oracle FETCH issues).

      Weird thing is, I started having re entrancy errors after that. The code is ** not ** reentrant, but I set reentrancy to true. Everything worked fine.

      I looked at the interceptor code and I am wondering if my observations would indicate that the ejb's are using the same lock for re entrancy checking as for deadlock checking. In any case, the reentrancy locking mechanism seem to be confused.

        • 1. Re: Weird re-entrancy/deadlocking problem
          Adrian Brock Master

          You shouldn't use CMP outside a transaction.

          It is impossible for an application server to
          distingish re-entrant from concurrent when
          there is no transactional lock.

          The deadlock issues are probably because you
          are missing indexs for some of the contraints
          in your DB. Oracle starts locking tables/whole columns
          when there is no index.

          Regards,
          Adrian

          • 2. Re: Weird re-entrancy/deadlocking problem
            citrosoft Newbie

            We are experiencing the same problem. We recently upgraded JBoss to 3.2.1 and set all of our Entity Bean get methods to be read only. We are using TX REQUIRED on all of our Entity Beans and our Session Fascade that accesses them.

            We now get a slew of Reentrant errors when running our concurrency load testing JUnit tests that we didn't get before. I sure would hate to have to move to reentrant EntityBeans just to work around this issue.

            In our case this has absolutely nothing to do with Oracle indexes.

            • 3. Re: Weird re-entrancy/deadlocking problem
              Adrian Brock Master

              Can you show your jboss.xml,
              even a read-only method will lock the bean instance
              for the duration of the getXXX().

              Setting reentrant won't help, you just move the
              elsewhere.

              Regards,
              Adrian

              • 4. Re: Weird re-entrancy/deadlocking problem
                citrosoft Newbie

                I figured out our problem. I had temporarily changed the lock-policy for all of our entity-beans to SimpleReadWriteEJBLock and forgot to swtich it back to QueuedPessimisticEJBLock. Once I put it back to QueuedPessimisticEJBLock the reentrancy errors went away.

                Thanks for the response.
                Mike