1 Reply Latest reply on Sep 25, 2009 7:42 AM by Fedor Cherepanov

    Cache does not release locked nodes on transaction rollback

    Fedor Cherepanov Newbie

      Hello, can you advise please on another issue I've got with JBoss-Cache (3.2) used with Atomicos tx server.

      When transaction server calls rollback on jta timeout, locks aren't released, probably because invocation context is not set on atomicos thread

      Here's the scenario:

      1. transaction started (by Spring transaction proxy)
      2. processing is done, cache updated
      3. precommit called - cacheloader writes updates to a database, it takes some time
      4. during precommit phase rollback called by atomicos on timeout
      5. locks are not released during rollback, because:
      rollback is called from atomicos thread
      lockManager.unlock(fqn, owner) is called with right owner (global transaction to be rolled back) but owner is not used in MVCCLockManager
      invocationContextContainer is empty, so OwnableReentrantLock tries current thread as the owner, causing IllegalMonitorException
      6. UnexpectedRollbackException is thrown on commit attempt, no other command issued to rollback so no locks released