Package io.micronaut.transaction
Interface TransactionStatus<T>
- Type Parameters:
T- The native transaction type
- All Superinterfaces:
io.micronaut.core.propagation.PropagatedContextElement,TransactionExecution
- All Known Subinterfaces:
InternalTransaction<T>
- All Known Implementing Classes:
AbstractInternalTransaction,DefaultTransactionStatus
public interface TransactionStatus<T>
extends TransactionExecution, io.micronaut.core.propagation.PropagatedContextElement
The transaction status.
- Since:
- 1.0.0
- Author:
- graemerocher, Denis Stepanov
-
Method Summary
Modifier and TypeMethodDescriptiondefault T@NonNull ConnectionStatus<T> @Nullable Objectdefault <V> VPropagated the currentPropagatedContextwith added connection status.default voidPropagated the currentPropagatedContextwith added connection status.default <V> VPropagated the currentPropagatedContextwith added connection status.default voidregisterSynchronization(@NonNull TransactionSynchronization synchronization) Register a new transaction synchronization for the current state.Methods inherited from interface io.micronaut.transaction.TransactionExecution
getTransactionDefinition, isCompleted, isNewTransaction, isRollbackOnly, setRollbackOnly
-
Method Details
-
getTransaction
- Returns:
- The underlying transaction object if exists.
-
getConnection
- Returns:
- The associated connection.
-
getConnectionStatus
- Returns:
- The connection status.
- Since:
- 4.0.0
-
registerSynchronization
Register a new transaction synchronization for the current state.Note that synchronizations can implement the
Orderedinterface. They will be executed in an order according to their order value (if any).- Parameters:
synchronization- the synchronization object to register
-
propagate
default <V> V propagate(io.micronaut.core.propagation.PropagatedContext propagatedContext, Supplier<V> supplier) Propagated the currentPropagatedContextwith added connection status.- Type Parameters:
V- The value type- Parameters:
propagatedContext- The propagated contextsupplier- The supplier- Returns:
- The value
- Since:
- 5.0
-
propagate
Propagated the currentPropagatedContextwith added connection status.- Type Parameters:
V- The value type- Parameters:
supplier- The supplier- Returns:
- The value
- Since:
- 5.0
-
propagate
Propagated the currentPropagatedContextwith added connection status.- Parameters:
runnable- The runnable- Since:
- 5.0
-