spring-framework / org.springframework.cache.transaction

Package org.springframework.cache.transaction

Types

TransactionAwareCacheDecorator

open class TransactionAwareCacheDecorator : Cache

Cache decorator which synchronizes its #put, #evict and #clear operations with Spring-managed transactions (through Spring's TransactionSynchronizationManager, performing the actual cache put/evict/clear operation only in the after-commit phase of a successful transaction. If no transaction is active, #put, #evict and #clear operations will be performed immediately, as usual.

Use of more aggressive operations such as #putIfAbsent cannot be deferred to the after-commit phase of a running transaction. Use these with care.

TransactionAwareCacheManagerProxy

open class TransactionAwareCacheManagerProxy : CacheManager, InitializingBean

Proxy for a target CacheManager, exposing transaction-aware Cache objects which synchronize their Cache#put operations with Spring-managed transactions (through Spring's org.springframework.transaction.support.TransactionSynchronizationManager, performing the actual cache put operation only in the after-commit phase of a successful transaction. If no transaction is active, Cache#put operations will be performed immediately, as usual.