T
- The transaction object if any, object otherwisepublic interface TransactionHandler<T>
Modifier and Type | Method and Description |
---|---|
void |
doBeginTransaction(T currentTransaction)
This method is called on transaction startup and marks the beginning of the transaction.
|
void |
doCleanup()
This method is invoked after transaction has ended (either successfully or not) and is responsible to clean
anything initialized by the doInitialize() method.
|
void |
doCommitTransaction(T currentTransaction)
This method is called when the transaction needs to be committed according to the policy specified by the
transaction metadata.
|
T |
doCreateTransaction()
This method is called on transaction creation and is responsible to return the object instance representing
the new transaction.
|
void |
doInitialize(TransactionMetadata transactionMetadata)
This method is called before the transaction creation and is responsible to execution any initialization
code necessary to the underlying implementation.
|
void |
doJoinGlobalTransaction()
This method is called when joining a global transaction is required by the transaction manager.
|
void |
doMarkTransactionAsRollbackOnly(T currentTransaction)
This method is called when the transaction needs to be marked as rollback only according to the policy specified
by the transaction metadata.
|
void |
doReleaseTransaction(T currentTransaction)
This method is called on transaction end to release the transaction object if needed.
|
void |
doRollbackTransaction(T currentTransaction)
This method is called when the transaction needs to be rollbacked according to the policy specified by the
transaction metadata.
|
T |
getCurrentTransaction()
This method is invoked before transaction initialization to check if a transaction already exists and can
eventually be reused.
|
void doInitialize(TransactionMetadata transactionMetadata)
The transactionMetadata is given by the TransactionManager
.
transactionMetadata
- The associated transaction metadata.T doCreateTransaction()
void doJoinGlobalTransaction()
void doBeginTransaction(T currentTransaction)
currentTransaction
- The transaction object as returned by doCreateTransaction(), null if none.void doCommitTransaction(T currentTransaction)
currentTransaction
- The transaction object as returned by doCreateTransaction(), null if none.void doMarkTransactionAsRollbackOnly(T currentTransaction)
currentTransaction
- The transaction object as returned by doCreateTransaction(), null if none.void doRollbackTransaction(T currentTransaction)
currentTransaction
- The transaction object as returned by doCreateTransaction(), null if none.void doReleaseTransaction(T currentTransaction)
currentTransaction
- The transaction object as returned by doCreateTransaction(), null if none.void doCleanup()
T getCurrentTransaction()
Copyright © 2013-2018–2019 SeedStack. All rights reserved.