Class SpringTransactionManager

java.lang.Object
org.axonframework.spring.messaging.unitofwork.SpringTransactionManager
All Implemented Interfaces:
org.axonframework.common.transaction.TransactionManager

public class SpringTransactionManager extends Object implements org.axonframework.common.transaction.TransactionManager
TransactionManager implementation that uses a PlatformTransactionManager as underlying transaction manager.
Since:
2.0
Author:
Allard Buijze
  • Constructor Summary

    Constructors
    Constructor
    Description
    SpringTransactionManager(org.springframework.transaction.PlatformTransactionManager transactionManager)
    Initializes the SpringTransactionManager with the given transactionManager and the default transaction definition.
    SpringTransactionManager(org.springframework.transaction.PlatformTransactionManager transactionManager, org.springframework.transaction.TransactionDefinition transactionDefinition)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    commitTransaction(org.springframework.transaction.TransactionStatus status)
    Commits the transaction with given status if the transaction is new and not completed.
    protected void
    rollbackTransaction(org.springframework.transaction.TransactionStatus status)
    Rolls back the transaction with given status if the transaction is new and not completed.
    org.axonframework.common.transaction.Transaction
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods 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 use
      transactionDefinition - The definition for transactions to create
    • SpringTransactionManager

      public SpringTransactionManager(org.springframework.transaction.PlatformTransactionManager transactionManager)
      Initializes the SpringTransactionManager with the given transactionManager and the default transaction definition.
      Parameters:
      transactionManager - the transaction manager to use
  • Method Details

    • startTransaction

      @Nonnull public org.axonframework.common.transaction.Transaction startTransaction()
      Specified by:
      startTransaction in interface org.axonframework.common.transaction.TransactionManager
    • commitTransaction

      protected void commitTransaction(org.springframework.transaction.TransactionStatus status)
      Commits the transaction with given status if 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 given status if the transaction is new and not completed.
      Parameters:
      status - The status of the transaction to roll back