-
Bug
-
Resolution: Won't Do
-
Critical
-
None
-
None
-
None
-
None
I am expecting the thread 2 be blocked in `cache.put(k1, v1)` until thread 1 has committed the transaction
According to the docs, using Pessimistic transactional cache, when cache.put(k1,v1) returns, k1 is locked and no other transaction running anywhere in the cluster can write to it. Reading k1 is still possible. The lock on k1 is released when the transaction completes (commits or rollbacks).
Cache Configuration
return new org.infinispan.configuration.cache.ConfigurationBuilder() .clustering().cacheMode(CacheMode.DIST_SYNC) .jmxStatistics().enable() .transaction() .cacheStopTimeout(0L) .transactionManagerLookup(new EmbeddedTransactionManagerLookup()) .lockingMode(LockingMode.PESSIMISTIC) .locking().isolationLevel(IsolationLevel.REPEATABLE_READ) .build();
Steps to reproduce
Thread t1 = { tm.begin() cache.put(k1, v1) long operation like 1 minute tm.commit() } Thread t2 = { long operation like 15 seconds tm.begin() cache.put(k1, v1) tm.commit() } t1.start() t2.start()
- is caused by
-
ISPN-9261 Hot Rod Lightweight Transaction (recovery)
- Closed