public class CacheTransactionHelper extends Object
Constructor and Description |
---|
CacheTransactionHelper() |
Modifier and Type | Method and Description |
---|---|
static void |
beginTransactionIfNeeded(Ehcache cache)
Begin a transaction on the current thread if the cache is configured as transactional,
otherwise this method does nothing.
|
static void |
commitTransactionIfNeeded(Ehcache cache)
Commit a transaction previously begun on the current thread if the cache is configured as
transactional, otherwise this method does nothing.
|
static boolean |
isTransactionStarted(Ehcache cache)
Check if a transaction has begun on the current thread if the cache is configured as
transactional, otherwise always return false.
|
public static void beginTransactionIfNeeded(Ehcache cache) throws CacheException
cache
- the cache to begin a transaction forCacheException
- if anything wrong happenspublic static void commitTransactionIfNeeded(Ehcache cache) throws CacheException
cache
- the cache to commit a transaction forCacheException
- if anything wrong happenspublic static boolean isTransactionStarted(Ehcache cache) throws CacheException
cache
- the cache to check if a transaction started forCacheException
- if anything wrong happensCopyright © 2003-2013 Terracotta, Inc.. All Rights Reserved.