Package io.micronaut.transaction.sync
Class SynchronousTransactionOperationsFromReactiveTransactionOperations<T>
java.lang.Object
io.micronaut.transaction.sync.SynchronousTransactionOperationsFromReactiveTransactionOperations<T>
- Type Parameters:
T
- The connection type
- All Implemented Interfaces:
TransactionOperations<T>
@Internal
public final class SynchronousTransactionOperationsFromReactiveTransactionOperations<T>
extends Object
implements TransactionOperations<T>
Implementation of the synchronous transaction operations using a reactive transaction operations.
- Since:
- 3.5.0
- Author:
- Denis Stepanov
-
Constructor Summary
ConstructorDescriptionSynchronousTransactionOperationsFromReactiveTransactionOperations
(ReactorReactiveTransactionOperations<T> reactiveTransactionOperations, ExecutorService blockingExecutorService) -
Method Summary
Modifier and TypeMethodDescription<R> R
execute
(TransactionDefinition definition, TransactionCallback<T, R> callback) Execute a transaction within the context of the function.Optional<? extends TransactionStatus<?>>
Find optional propagated transaction status.Obtains the connection for the current transaction.boolean
Check if the connection exists.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.micronaut.transaction.TransactionOperations
executeRead, executeWrite
-
Constructor Details
-
SynchronousTransactionOperationsFromReactiveTransactionOperations
public SynchronousTransactionOperationsFromReactiveTransactionOperations(ReactorReactiveTransactionOperations<T> reactiveTransactionOperations, ExecutorService blockingExecutorService)
-
-
Method Details
-
getConnection
Description copied from interface:TransactionOperations
Obtains the connection for the current transaction.- Specified by:
getConnection
in interfaceTransactionOperations<T>
- Returns:
- The connection
-
hasConnection
public boolean hasConnection()Description copied from interface:TransactionOperations
Check if the connection exists.- Specified by:
hasConnection
in interfaceTransactionOperations<T>
- Returns:
- True if transaction exists
-
findTransactionStatus
Description copied from interface:TransactionOperations
Find optional propagated transaction status.- Specified by:
findTransactionStatus
in interfaceTransactionOperations<T>
- Returns:
- The transaction status.
-
execute
Description copied from interface:TransactionOperations
Execute a transaction within the context of the function.- Specified by:
execute
in interfaceTransactionOperations<T>
- Type Parameters:
R
- The result- Parameters:
definition
- The transaction definitioncallback
- The call back- Returns:
- The result
-