4 Replies Latest reply on Mar 11, 2010 3:57 PM by Mircea Markus

    How to aquire cluster-wide lock for non-transactional cache?

    Lin Ye Expert
      I was testing with simple non-transactional cache with synchronous replication. I tried to update randomly from two cache instances on a range of keys, and there is a big chance for a deadlock. It seems when the two keys being updated fall into the same lock striping, both of them acquired the local lock but failed remotely during replication. I was using the default configuration - that's useLockStriping=true & concurrencyLevel=512  When I disabled  useLockStriping, the chance reduced as I guess it would only happens when they access the exact same key. I would like to lock the key cluster-wide to prevent it, but the cache.lock(key) doesn't apply to non-transactional context. Could you please suggest how to prevent such kind of deadlock?