1 Reply Latest reply: Nov 25, 2011 9:41 AM by Galder Zamarreño RSS

use1PcForAutoCommitTransactions question

Mathieu Lachance Newbie

Hello,

I'd like to know what would happen with the new Infinispan 5.1.0.CR1 "use1PcForAutoCommitTransactions" feature if we're using a transactionnal pessimistic cache like this :

 

// begin transaction

cache.getAdvancedCache().getTransactionManager().begin();

// lock key

cache.getAdvancedCache().lock("key");

// get value from key

String value = cache.get("key");

// do some business logic, that would lead to an update

cache.put("key", value);

// finally, commit

cache.getAdvancedCache().getTransactionManager().commit();

 

if I understand well, being pessismistic ensure there won't be any concurrent modification on the key, tough, in this scenario we do not rely on auto commit. would it be possible to gain access to 1PC even tough we're not using autoCommit or there's something I'm missing ?

 

Thanks