2 Replies Latest reply on Sep 14, 2007 8:13 AM by Manik Surtani

    Sometimes aquired locks are not released

    Jacek Halat Newbie


      I'm found, that sometimes PojoCache never releases aquired locks! (v 1.4.1 SP4)
      Probably this situation occurs, when transactions are rolled back, but I'm not sure. This is very hard to see this exception in real systems, but when ocurs - whole JVM must be restarted :(. On my systems it occurs until now 5 times and always under heavy load.

      Main loop looks like:

       while (true) {
       for (int x = 0; x < 2; x++) {
       WorkThread t = new WorkThread(x == 1);
       for (WorkThread separateThread : threads) {
       if (separateThread.getException() != null) {
       int locksNum = getNumberOfLocksHeld();
      // System.out.println("Locks="+locksNum);
       // checkpoint
       if (cache.getNumberOfLocksHeld()>0){
       System.out.println("ERROR, locks="+locksNum);
       assertEquals(0, locksNum);

      Generally after checkpoint line number of helds locks is 0, but sometimes (very, very rarely) number of locks is greater than 0!!!! If this occurs, some node is locked and nobody can read/write this node - only stop/start treecache can help.

      Does anybody else has this problem?