Interface TransactionHandler
-
public interface TransactionHandlerContains utility methods to run transactions. It is different from Spring'sTransactionTemplatebecause it handles the currentInvocationContext'sEntityManager
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default <T> Pair<T,Boolean>run(TransactionLevel transactionLevel, TransactionCallback<T> callback)Runs the given transaction callback in the current thread, forcing there's no current transaction.<T> Pair<T,Boolean>run(TransactionLevel transactionLevel, TransactionCallback<T> callback, int retryCount)Runs the given transaction callback in the current thread, forcing there's no current transaction.
-
-
-
Method Detail
-
run
default <T> Pair<T,Boolean> run(TransactionLevel transactionLevel, TransactionCallback<T> callback)
Runs the given transaction callback in the current thread, forcing there's no current transaction. The transaction will comply with the givenTransactionLevel.- Returns:
- a
Pairwith the callback's result and a boolean indicating if the transaction was committed or not.
-
run
<T> Pair<T,Boolean> run(TransactionLevel transactionLevel, TransactionCallback<T> callback, int retryCount)
Runs the given transaction callback in the current thread, forcing there's no current transaction. The transaction will comply with the givenTransactionLevel.- Returns:
- a
Pairwith the callback's result and a boolean indicating if the transaction was committed or not.
-
-