Prerequisites

  1. WmEhcacheTransactionManager.jar should be present under <IntergrationServer_dir>/lib/jars folder. (This is required only if planning to use xa or xa_strict transaction. This jar contains Transaction Manager Lookup implementation which is required by Ehcache for XA transactions)

Configuration

Transactions are enabled on a cache by cache basis with the transactionalMode cache attribute.

The allowed values are:

The default value is off.

Local Transactions:

Enabling a cache for local transactions is shown in the following example:

  1. Shutdown your CacheManager from IS admin
  2. Shutdown terracotta server (if using for distributed caching)
  3. Open <IntergrationServer_dir>/config/Caching/<CacheManagerName>.xml file
  4. Add transactionMode attribute to desired cache element as shown below:
    	<cache name="localCache"
    		maxElementsInMemory="500"
    		eternal="false"
    		timeToIdleSeconds="300"
    		timeToLiveSeconds="600"
    		overflowToDisk="false"
    		diskPersistent="false"
    		diskExpiryThreadIntervalSeconds="1"
    		transactionalMode="local">
    	</cache>	
    	
  5. Save file and Start terracotta server (if using for distributed caching)
  6. Start your CacheManager from IS admin
  7. If CacheManager started successfully then you are good to go and use transaction services from WxEhcache package.
  8. If CacheManager does not start successfully then please try restarting Integration Server and then Starting Cache Manager again.

XA or XA_STRICT Transactions:

Enabling a cache for xa or xa_strict transactions is shown in the following example:

  1. Shutdown your CacheManager from IS admin
  2. Shutdown terracotta server (if using for distributed caching)
  3. Open <IntergrationServer_dir>/config/Caching/<CacheManagerName>.xml file
  4. Add below transactionManagerLookup tag in XML file.
    	<transactionManagerLookup
    	class= "com.wm.ehcache.transactionmanager.WmTransactionManagerLookup"
    	properties="" propertySeparator=":"/>
    		
  5. Add transactionMode attribute to desired cache element as shown below:
    	<cache name="xaCache"
    		maxElementsInMemory="500"
    		eternal="false"
    		timeToIdleSeconds="300"
    		timeToLiveSeconds="600"
    		overflowToDisk="false"
    		diskPersistent="false"
    		diskExpiryThreadIntervalSeconds="1"
    		transactionalMode="xa">
    	</cache>	
    	
  6. Save file and Start terracotta server (if using for distributed caching)
  7. Start your CacheManager from IS admin
  8. If CacheManager started successfully then you are good to go and use transaction services from WxEhcache package.
  9. If CacheManager does not start successfully then please try restarting Integration Server and then Starting Cache Manager again.