Interface TransactionExecutionListener
public interface TransactionExecutionListener
Callback interface for stateless listening to transaction creation/completion steps
in a transaction manager. This is primarily meant for observation and statistics;
consider stateful transaction synchronizations for resource management purposes.
In contrast to synchronizations, the transaction execution listener contract is
commonly supported for thread-bound transactions as well as reactive transactions.
The callback-provided TransactionExecution object will be either a
TransactionStatus (for a PlatformTransactionManager transaction) or
a ReactiveTransaction (for a ReactiveTransactionManager transaction).
- Since:
- 6.1
- Author:
- Juergen Hoeller
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidafterBegin(TransactionExecution transaction, @Nullable Throwable beginFailure) Callback after the transaction begin step.default voidafterCommit(TransactionExecution transaction, @Nullable Throwable commitFailure) Callback after the transaction commit step.default voidafterRollback(TransactionExecution transaction, @Nullable Throwable rollbackFailure) Callback after the transaction rollback step.default voidbeforeBegin(TransactionExecution transaction) Callback before the transaction begin step.default voidbeforeCommit(TransactionExecution transaction) Callback before the transaction commit step.default voidbeforeRollback(TransactionExecution transaction) Callback before the transaction rollback step.
-
Method Details
-
beforeBegin
Callback before the transaction begin step.- Parameters:
transaction- the current transaction
-
afterBegin
Callback after the transaction begin step.- Parameters:
transaction- the current transactionbeginFailure- an exception occurring during begin (ornullafter a successful begin step)
-
beforeCommit
Callback before the transaction commit step.- Parameters:
transaction- the current transaction
-
afterCommit
Callback after the transaction commit step.- Parameters:
transaction- the current transactioncommitFailure- an exception occurring during commit (ornullafter a successful commit step)
-
beforeRollback
Callback before the transaction rollback step.- Parameters:
transaction- the current transaction
-
afterRollback
Callback after the transaction rollback step.- Parameters:
transaction- the current transactionrollbackFailure- an exception occurring during rollback (ornullafter a successful rollback step)
-