Product Documentation : Ehcache Developer Guide : Transaction Support : Configuring Transactional Cache
Configuring Transactional Cache
Transactions are enabled on a cache-by-cache basis with the transactionalMode cache attribute. The allowed values are:
The default value is “off.” In the following example, “xa_strict” is enabled.
<cache name="xaCache"
Transactional Caches with Spring
Note the following when using Spring:
*If you access the cache from an @Transactional Spring-annotated method, begin/commit/rollback statements are not required in application code because they are emitted by Spring.
*Both Spring and Ehcache need to access the transaction manager internally, and therefore you must inject your chosen transaction manager into Spring's PlatformTransactionManager as well as use an appropriate lookup strategy for Ehcache.
*The Ehcache default lookup strategy might not be able to detect your chosen transaction manager. For example, it cannot detect the WebSphere transaction manager. For additional information, see the Transaction Managers.
*Configuring a <tx:method> with read-only=true could be problematic with certain transaction managers such as WebSphere.
Copyright © 2010-2015 Software AG, Darmstadt, Germany.

Product Logo |   Feedback