-
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface ContextTransactionalCallable<T>
AnFunctionalInterfacethat wraps transactional code.This callable may depend on captured scope ("context") in order to discover a contextual
Configurationto be used to create new SQL statements. Clients are responsible to implement such context state in appropriateConnectionProviderandTransactionProviderimplementations.An out-of-the-box implementation for a fitting
TransactionProvideris available throughThreadLocalTransactionProvider.- Author:
- Lukas Eder
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Trun()Run the transactional code.
-
-
-
Method Detail
-
run
T run() throws Throwable
Run the transactional code.If this method completes normally, and this is not a nested transaction, then the transaction will be committed. If this method completes with an exception (any
Throwable), then the transaction is rolled back to the beginning of thisContextTransactionalCallable.- Returns:
- The outcome of the transaction.
- Throws:
Throwable- Any exception that will cause a rollback of the code contained in this transaction. If this is a nested transaction, the rollback may be performed only to the state before executing thisContextTransactionalCallable.
-
-