2 Replies Latest reply: Mar 9, 2011 3:23 AM by Galder Zamarreño RSS

Explicit distributed eager locking

Bertrand Renuart Newbie

Hello everybody,

 

Please consider a scenario with hosts with "EmbeddedCaches" configured as a cluster (clustering mode: replicated, isolation level: READ_COMMITTED, synchroneous replication).

 

       Host 1                Host 2    

  (1)  tx.begin()

  (2)                        tx.begin()

  (3)  cache.lock(K1)                          

  (4)                        cache.lock(K2)

 

Note: both keys existed in the cache before the transactions started.


Lock on K1 is successfully acquired by host1 at step 3.

At step 4, host2 fails to acquire lock on K2 until transaction on host1 is either committed or rollback or until the lock acquisition process times out.

 

--> This looks rather strange to me since I would expect that the second host could lock K2 without any problem since nobody in the cluster holds a lock on it at this time.

 

Can someone tell me what I missed ?

 

PS: this test was made with Infinispan 4.2.1.CR1, transactions controlled via the DummyJTATransaction manager.