Raghav
Raghav

Reputation: 67

Infinispan - Transaction Manager over Hot Rod Client API

I am using infinispan 12.0.2 FINAL over hot rod client but I am unable to get the transaction manager to work.

Here is how I am configuring my caches:

ConfigurationBuilder builder = new ConfigurationBuilder();
    builder.clustering().cacheMode(CacheMode.DIST_SYNC);
    builder.locking().isolationLevel(IsolationLevel.REPEATABLE_READ);
    builder.transaction().lockingMode(LockingMode.PESSIMISTIC);
    builder.transaction().transactionMode(org.infinispan.transaction.TransactionMode.TRANSACTIONAL);
    builder.transaction().transactionManagerLookup(org.infinispan.client.hotrod.transaction.lookup.GenericTransactionManagerLookup.getInstance());          
rcm.administration().withFlags(CacheContainerAdmin.AdminFlag.VOLATILE).getOrCreateCache(cacheName,
                builder.build());       

But everytime I try to access the transaction by remoteCachne.getTransactionManager, I am getting a null for transaction Manager.
I am not able to figure out the issue. Please help in this.

Upvotes: 0

Views: 362

Answers (1)

pruivo
pruivo

Reputation: 1344

After enabling transactions in the server cache, you need to enable transactions in the remote cache as well.

Check the Hot Rod Documentation how to do it.

Upvotes: 2

Related Questions