public class HazelcastTransactionManager
extends org.springframework.transaction.support.AbstractPlatformTransactionManager
implements org.springframework.transaction.support.ResourceTransactionManager
PlatformTransactionManager
implementation
for a single HazelcastInstance
. Binds a Hazelcast TransactionContext
from the instance to the thread (as it is already bounded by Hazelcast itself) and makes it available for access.
Note: This transaction manager doesn't supports nested transactions, since Hazelcast doesn't support them either.
getTransactionContext(HazelcastInstance)
,
getTransactionContext()
,
Serialized FormConstructor and Description |
---|
HazelcastTransactionManager(HazelcastInstance hazelcastInstance) |
Modifier and Type | Method and Description |
---|---|
protected void |
doBegin(Object transaction,
org.springframework.transaction.TransactionDefinition definition) |
protected void |
doCleanupAfterCompletion(Object transaction) |
protected void |
doCommit(org.springframework.transaction.support.DefaultTransactionStatus status) |
protected Object |
doGetTransaction() |
protected void |
doRollback(org.springframework.transaction.support.DefaultTransactionStatus status) |
protected void |
doSetRollbackOnly(org.springframework.transaction.support.DefaultTransactionStatus status) |
Object |
getResourceFactory() |
TransactionContext |
getTransactionContext()
Returns the transaction context
|
static TransactionContext |
getTransactionContext(HazelcastInstance hazelcastInstance)
Returns the transaction context for the given Hazelcast instance bounded to the current thread.
|
protected boolean |
isExistingTransaction(Object transaction) |
commit, determineTimeout, doResume, doSuspend, getDefaultTimeout, getTransaction, getTransactionSynchronization, invokeAfterCompletion, isFailEarlyOnGlobalRollbackOnly, isGlobalRollbackOnParticipationFailure, isNestedTransactionAllowed, isRollbackOnCommitFailure, isValidateExistingTransaction, newTransactionStatus, prepareForCommit, prepareSynchronization, prepareTransactionStatus, registerAfterCompletionWithExistingTransaction, resume, rollback, setDefaultTimeout, setFailEarlyOnGlobalRollbackOnly, setGlobalRollbackOnParticipationFailure, setNestedTransactionAllowed, setRollbackOnCommitFailure, setTransactionSynchronization, setTransactionSynchronizationName, setValidateExistingTransaction, shouldCommitOnGlobalRollbackOnly, suspend, triggerBeforeCommit, triggerBeforeCompletion, useSavepointForNestedTransaction
public HazelcastTransactionManager(HazelcastInstance hazelcastInstance)
public static TransactionContext getTransactionContext(HazelcastInstance hazelcastInstance)
org.springframework.transaction.NoTransactionException
- if the transaction context cannot be foundpublic TransactionContext getTransactionContext()
org.springframework.transaction.NoTransactionException
- if the transaction context cannot be foundpublic Object getResourceFactory()
getResourceFactory
in interface org.springframework.transaction.support.ResourceTransactionManager
protected Object doGetTransaction() throws org.springframework.transaction.TransactionException
doGetTransaction
in class org.springframework.transaction.support.AbstractPlatformTransactionManager
org.springframework.transaction.TransactionException
protected boolean isExistingTransaction(Object transaction) throws org.springframework.transaction.TransactionException
isExistingTransaction
in class org.springframework.transaction.support.AbstractPlatformTransactionManager
org.springframework.transaction.TransactionException
protected void doBegin(Object transaction, org.springframework.transaction.TransactionDefinition definition) throws org.springframework.transaction.TransactionException
doBegin
in class org.springframework.transaction.support.AbstractPlatformTransactionManager
org.springframework.transaction.TransactionException
protected void doCommit(org.springframework.transaction.support.DefaultTransactionStatus status) throws org.springframework.transaction.TransactionException
doCommit
in class org.springframework.transaction.support.AbstractPlatformTransactionManager
org.springframework.transaction.TransactionException
protected void doSetRollbackOnly(org.springframework.transaction.support.DefaultTransactionStatus status) throws org.springframework.transaction.TransactionException
doSetRollbackOnly
in class org.springframework.transaction.support.AbstractPlatformTransactionManager
org.springframework.transaction.TransactionException
protected void doRollback(org.springframework.transaction.support.DefaultTransactionStatus status) throws org.springframework.transaction.TransactionException
doRollback
in class org.springframework.transaction.support.AbstractPlatformTransactionManager
org.springframework.transaction.TransactionException
protected void doCleanupAfterCompletion(Object transaction)
doCleanupAfterCompletion
in class org.springframework.transaction.support.AbstractPlatformTransactionManager
Copyright © 2017 Hazelcast, Inc.. All Rights Reserved.