public interface TransactionWrapper
Implementations are responsible for:
Transaction-scoped dependencies (e.g., database sessions, transaction handles) should be injected into the runtime after starting the transaction, making them available to the change during execution.
| Modifier and Type | Method and Description |
|---|---|
<T> T |
wrapInTransaction(ExecutionRuntime injectableContextProvider,
java.util.function.Function<ExecutionRuntime,T> operation)
Wraps the execution of an operation within a transaction.
|
<T> T wrapInTransaction(ExecutionRuntime injectableContextProvider, java.util.function.Function<ExecutionRuntime,T> operation)
The implementation should follow this pattern:
T - the return type of the operationinjectableContextProvider - the execution runtime for dependency injectionoperation - the function to execute within the transactionjava.lang.RuntimeException - if the transaction fails