Class SpringTransactionManager
java.lang.Object
org.axonframework.spring.messaging.unitofwork.SpringTransactionManager
- All Implemented Interfaces:
TransactionManager
TransactionManager implementation that uses a
PlatformTransactionManager as
underlying transaction manager.- Since:
- 2.0
- Author:
- Allard Buijze
-
Constructor Summary
ConstructorsConstructorDescriptionSpringTransactionManager(org.springframework.transaction.PlatformTransactionManager transactionManager) Initializes the SpringTransactionManager with the giventransactionManagerand the default transaction definition.SpringTransactionManager(org.springframework.transaction.PlatformTransactionManager transactionManager, org.springframework.transaction.TransactionDefinition transactionDefinition) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcommitTransaction(org.springframework.transaction.TransactionStatus status) Commits the transaction with givenstatusif the transaction is new and not completed.protected voidrollbackTransaction(org.springframework.transaction.TransactionStatus status) Rolls back the transaction with givenstatusif the transaction is new and not completed.Starts a transaction.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.axonframework.common.transaction.TransactionManager
executeInTransaction, fetchInTransaction
-
Constructor Details
-
SpringTransactionManager
public SpringTransactionManager(org.springframework.transaction.PlatformTransactionManager transactionManager, org.springframework.transaction.TransactionDefinition transactionDefinition) - Parameters:
transactionManager- The transaction manager to usetransactionDefinition- The definition for transactions to create
-
SpringTransactionManager
public SpringTransactionManager(org.springframework.transaction.PlatformTransactionManager transactionManager) Initializes the SpringTransactionManager with the giventransactionManagerand the default transaction definition.- Parameters:
transactionManager- the transaction manager to use
-
-
Method Details
-
startTransaction
Description copied from interface:TransactionManagerStarts a transaction. The return value is the started transaction that can be committed or rolled back.- Specified by:
startTransactionin interfaceTransactionManager- Returns:
- The object representing the transaction
-
commitTransaction
protected void commitTransaction(org.springframework.transaction.TransactionStatus status) Commits the transaction with givenstatusif the transaction is new and not completed.- Parameters:
status- The status of the transaction to commit
-
rollbackTransaction
protected void rollbackTransaction(org.springframework.transaction.TransactionStatus status) Rolls back the transaction with givenstatusif the transaction is new and not completed.- Parameters:
status- The status of the transaction to roll back
-