|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.springframework.transaction.support.AbstractPlatformTransactionManager
org.springframework.data.gemfire.GemfireTransactionManager
public class GemfireTransactionManager
Local transaction manager for GemFire Enterprise Fabric (GEF). Provides a
PlatformTransactionManager implementation for a single GemFire
CacheTransactionManager.
Binds one or multiple GemFire regions for the specified Cache to the
thread, potentially allowing for one region per cache model.
This local strategy is an alternative to executing cache operations within JTA transactions. Its advantage is that is able to work in any environment, for example a stand-alone application or a test suite. It is not able to provide XA transactions, for example to share transactions with data access.
To prevent dirty reads, by default, the cache is configured to return copies
rather then direct references for get operations. As a
workaround, one could use explicitly deep copy objects before making changes
to them to avoid unnecessary copying on every fetch.
CacheTransactionManager,
GemFireCache.setCopyOnRead(boolean),
Region.get(Object),
CopyHelper.copy(Object),
setCopyOnRead(boolean),
AbstractPlatformTransactionManager,
Serialized Form| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.springframework.transaction.support.AbstractPlatformTransactionManager |
|---|
AbstractPlatformTransactionManager.SuspendedResourcesHolder |
| Field Summary |
|---|
| Fields inherited from class org.springframework.transaction.support.AbstractPlatformTransactionManager |
|---|
logger, SYNCHRONIZATION_ALWAYS, SYNCHRONIZATION_NEVER, SYNCHRONIZATION_ON_ACTUAL_TRANSACTION |
| Constructor Summary | |
|---|---|
GemfireTransactionManager()
Creates a new GemfireTransactionManager instance. |
|
GemfireTransactionManager(com.gemstone.gemfire.cache.Cache cache)
Creates a new GemfireTransactionManager instance. |
|
| Method Summary | ||
|---|---|---|
void |
afterPropertiesSet()
|
|
protected void |
doBegin(Object transaction,
TransactionDefinition definition)
|
|
protected void |
doCleanupAfterCompletion(Object transaction)
|
|
protected void |
doCommit(DefaultTransactionStatus status)
|
|
protected Object |
doGetTransaction()
|
|
protected void |
doRollback(DefaultTransactionStatus status)
|
|
protected void |
doSetRollbackOnly(DefaultTransactionStatus status)
|
|
com.gemstone.gemfire.cache.Cache |
getCache()
Returns the Cache that this instance manages local transactions for. |
|
Object |
getResourceFactory()
|
|
boolean |
isCopyOnRead()
Indicates whether copy on read is set or not on the transaction manager. |
|
protected boolean |
isExistingTransaction(Object transaction)
|
|
void |
setCache(com.gemstone.gemfire.cache.Cache cache)
Sets the Cache that this instance manages local transactions for. |
|
void |
setCopyOnRead(boolean copyOnRead)
Indicates whether the cache returns direct references or copies of the objects (default) it manages. |
|
|
setRegion(com.gemstone.gemfire.cache.Region<K,V> region)
Sets the Gemfire Region (as an alternative in setting in the
cache directly). |
|
protected boolean |
useSavepointForNestedTransaction()
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.springframework.transaction.PlatformTransactionManager |
|---|
commit, getTransaction, rollback |
| Constructor Detail |
|---|
public GemfireTransactionManager()
public GemfireTransactionManager(com.gemstone.gemfire.cache.Cache cache)
cache - | Method Detail |
|---|
public void afterPropertiesSet()
afterPropertiesSet in interface InitializingBean
protected Object doGetTransaction()
throws TransactionException
doGetTransaction in class AbstractPlatformTransactionManagerTransactionException
protected boolean isExistingTransaction(Object transaction)
throws TransactionException
isExistingTransaction in class AbstractPlatformTransactionManagerTransactionException
protected void doBegin(Object transaction,
TransactionDefinition definition)
throws TransactionException
doBegin in class AbstractPlatformTransactionManagerTransactionException
protected void doCommit(DefaultTransactionStatus status)
throws TransactionException
doCommit in class AbstractPlatformTransactionManagerTransactionException
protected void doRollback(DefaultTransactionStatus status)
throws TransactionException
doRollback in class AbstractPlatformTransactionManagerTransactionExceptionprotected void doSetRollbackOnly(DefaultTransactionStatus status)
doSetRollbackOnly in class AbstractPlatformTransactionManagerprotected void doCleanupAfterCompletion(Object transaction)
doCleanupAfterCompletion in class AbstractPlatformTransactionManagerprotected final boolean useSavepointForNestedTransaction()
useSavepointForNestedTransaction in class AbstractPlatformTransactionManagerpublic com.gemstone.gemfire.cache.Cache getCache()
public void setCache(com.gemstone.gemfire.cache.Cache cache)
cache - Gemfire cachepublic Object getResourceFactory()
getResourceFactory in interface ResourceTransactionManagerpublic <K,V> void setRegion(com.gemstone.gemfire.cache.Region<K,V> region)
Region (as an alternative in setting in the
cache directly).
region - Gemfire regionpublic void setCopyOnRead(boolean copyOnRead)
CopyHelper.copy(Object) in which
case this setting can be set to false. However, unless there
is a measurable performance penalty, the recommendation is to keep this
setting to true
copyOnRead - whether copies (default) rather then direct references
will be returned on fetch operationspublic boolean isCopyOnRead()
setCopyOnRead(boolean)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||