Package io.micronaut.transaction.support
Interface TransactionStateOperations<T,S extends TransactionState>
- Type Parameters:
T- The resource type, such as the connection.S- The transaction state type
- All Known Implementing Classes:
AbstractSynchronousStateTransactionManager,AbstractSynchronousTransactionManager,DataSourceTransactionManager,HibernateTransactionManager,MongoSynchronousTransactionManagerImpl
Generic transaction state operations interface.
- Since:
- 3.4.0
- Author:
- graemerocher, Denis Stepanov
-
Method Summary
Modifier and TypeMethodDescription<R> Rexecute(S state, TransactionDefinition definition, TransactionCallback<T, R> callback) Execute a read-only transaction within the context of the function.<R> RexecuteRead(S state, TransactionCallback<T, R> callback) Execute a read-only transaction within the context of the function.<R> RexecuteWrite(S state, TransactionCallback<T, R> callback) Execute a default transaction within the context of the function.
-
Method Details
-
execute
<R> R execute(@NonNull S state, @NonNull TransactionDefinition definition, @NonNull TransactionCallback<T, R> callback) Execute a read-only transaction within the context of the function.- Type Parameters:
R- The result- Parameters:
state- The transaction statedefinition- The transaction definitioncallback- The call back- Returns:
- The result
-
executeRead
Execute a read-only transaction within the context of the function.- Type Parameters:
R- The result- Parameters:
state- The transaction statecallback- The call back- Returns:
- The result
-
executeWrite
Execute a default transaction within the context of the function.- Type Parameters:
R- The result- Parameters:
state- The transaction statecallback- The call back- Returns:
- The result
-