19.4.2. Obtain the Transaction Manager From the Cache

Use the following configuration after initialization to obtain the TransactionManager from the cache:

Procedure 19.1. Obtain the Transaction Manager from the Cache

  1. Define a transactionManagerLookupClass by adding the following property to your BasicCacheContainer's configuration location properties:
    Configuration config = new ConfigurationBuilder()
    ...
      .transaction().transactionManagerLookup(new GenericTransactionManagerLookup())
    
  2. Call TransactionManagerLookup.getTransactionManager as follows:
    TransactionManager tm = cache.getAdvancedCache().getTransactionManager();