4 Replies Latest reply on Oct 7, 2011 11:25 AM by Galder Zamarreño

    Unable to acquire lock

    Nikolay Kondrashov Newbie



      Two nodes running on the same machine. (v4.2.1)

      The frst node reads data from AtomicMap. The second node puts data into the same AtomicMap.


      I'm getting on the reader's side:

      org.infinispan.util.concurrent.TimeoutException: Unable to acquire lock after [10 seconds] on key [my_atomic_map_key] for requestor [GlobalTransaction:<nykdwm2056268-2968>:1:remote]! Lock held by [GlobalTransaction:<nykdwm2056268-13254>:3016:local]
                at org.infinispan.container.EntryFactoryImpl.acquireLock(EntryFactoryImpl.java:228)

      On the writer's side:

      javax.transaction.RollbackException: Exception rolled back, status is: 9
                at org.infinispan.transaction.tm.DummyTransaction.commit(DummyTransaction.java:92)
                at org.infinispan.transaction.tm.DummyBaseTransactionManager.commit(DummyBaseTransactionManager.java:96)
                at InfiniCacheBenchmarkWrite.main(InfiniCacheBenchmarkWrite.java:52)


      Reader freezes at cache.getAdvancedCache().lock("my_atomic_map_key");

      After 10 sec I get the exception above.


      for (;;) {
                Object lastKey = null;
                map = AtomicMapLookup.getAtomicMap(cache, "my_atomic_map_key");
                for(Object key : (Set)map.keySet()){
                          lastKey = key;



                  for (int i = 0 ; i < 2000; i++) {
                      map.put("" + i, i);



                <jmxStatistics enabled="true"/>
                <clustering mode="replication">
                          <stateRetrieval fetchInMemoryState="true" timeout="20000"/>
                <invocationBatching enabled="true"/>


      Could you clarify please? Why does Reader hang on .lock call?

      Thank you