[infinispan-issues] [JBoss JIRA] (ISPN-9412) HotRod Transaction Cache PESSIMISTIC locking mode is not locking the key in another transaction

Diego Lovison (JIRA) issues at jboss.org
Wed Aug 8 09:42:00 EDT 2018


     [ https://issues.jboss.org/browse/ISPN-9412?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Diego Lovison updated ISPN-9412:
--------------------------------
    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()



  was:
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, v2)
   tm.commit()
}

t1.start()
t2.start()





> HotRod Transaction Cache PESSIMISTIC locking mode is not locking the key in another transaction
> -----------------------------------------------------------------------------------------------
>
>                 Key: ISPN-9412
>                 URL: https://issues.jboss.org/browse/ISPN-9412
>             Project: Infinispan
>          Issue Type: Bug
>            Reporter: Diego Lovison
>            Priority: Critical
>
> 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
> {code:java}
>       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();
> {code}



--
This message was sent by Atlassian JIRA
(v7.5.0#75005)


More information about the infinispan-issues mailing list