4 Replies Latest reply on Nov 15, 2004 5:31 AM by Eduardo Frutuoso

    Error: lock < 0

    Eduardo Frutuoso Newbie

      Hello guys...

      I´m using a JBOSS 3.2.6 in production and doing some really heavy load tests (400+ users).
      In the first attempt , the server enters in a deadlock, I think we must redesing some ways of access the beans.. But we (me and my team) need to put the application in production very fast... So we changed the lock policy to NoLock ... Then a strange error happens sometimes... Sometimes the test finish with success but sometimes we have a exception thrown (Throwable) with a message "lock < 0".
      Searching in the source , I´ve found this in EnterpriseContext.java

       public void unlock() {
       // release a lock
       locked --;
       //new Exception().printStackTrace();
       if (locked <0) {
       // new Exception().printStackTrace();
       log.error("locked < 0", new Throwable());
       //DEBUG log.debug("EnterpriseContext.unlock() "+hashCode()+" "+locked);

      I´m thinking, using the NoLock policy, two different threads possibly enter in this method concurrently and then result in the error... This is a normal situation using the NoLock policy??? Maybe this method (and the lock) must be synchronized??? There is a workaround???

      I´m using the commit option A with many cache optimizations...

      Guys I really need help here...

      Thank you so much

      Eduardo Rodrigues