org.axonframework.unitofwork
Interface TransactionManager<T>

Type Parameters:
T - The type of object used to represent the transaction
All Known Implementing Classes:
NoTransactionManager, SpringTransactionManager

public interface TransactionManager<T>

Interface towards a mechanism that manages transactions

Typically, this will involve opening database transactions or connecting to external systems.

Since:
2.0
Author:
Allard Buijze

Method Summary
 void commitTransaction(T transactionStatus)
          Commits the transaction identifier by given transactionStatus.
 void rollbackTransaction(T transactionStatus)
          Rolls back the transaction identifier by given transactionStatus.
 T startTransaction()
          Starts a transaction.
 

Method Detail

startTransaction

T startTransaction()
Starts a transaction. The return value is an object representing the transaction status and must be passed as an argument when invoking commitTransaction(Object) or rollbackTransaction(Object).

The returned object must never be null if a transaction was successfully created.

Returns:
The object representing the transaction status

commitTransaction

void commitTransaction(T transactionStatus)
Commits the transaction identifier by given transactionStatus.

Parameters:
transactionStatus - The status object provided by startTransaction().

rollbackTransaction

void rollbackTransaction(T transactionStatus)
Rolls back the transaction identifier by given transactionStatus.

Parameters:
transactionStatus - The status object provided by startTransaction().


Copyright © 2010-2016. All Rights Reserved.