Package io.micronaut.transaction.support
Class AbstractReactorTransactionOperations.DefaultReactiveTransactionStatus<C>
java.lang.Object
io.micronaut.transaction.support.AbstractReactorTransactionOperations.DefaultReactiveTransactionStatus<C>
- Type Parameters:
C
- The connection type
- All Implemented Interfaces:
ReactiveTransactionStatus<C>
,TransactionExecution
- Enclosing class:
- AbstractReactorTransactionOperations<C>
protected static final class AbstractReactorTransactionOperations.DefaultReactiveTransactionStatus<C>
extends Object
implements ReactiveTransactionStatus<C>
Represents the current reactive transaction status.
-
Constructor Summary
ConstructorDescriptionDefaultReactiveTransactionStatus
(ConnectionStatus<C> connectionStatus, boolean isNew, TransactionDefinition transactionDefinition) -
Method Summary
Modifier and TypeMethodDescriptionThe transaction definition.boolean
Return whether this transaction is completed, that is, whether it has already been committed or rolled back.boolean
Return whether the present transaction is new; otherwise participating in an existing transaction, or potentially not running in an actual transaction in the first place.boolean
Return whether the transaction has been marked as rollback-only (either by the application or by the transaction infrastructure).void
Set the transaction rollback-only.
-
Constructor Details
-
DefaultReactiveTransactionStatus
public DefaultReactiveTransactionStatus(ConnectionStatus<C> connectionStatus, boolean isNew, TransactionDefinition transactionDefinition)
-
-
Method Details
-
getConnectionStatus
- Specified by:
getConnectionStatus
in interfaceReactiveTransactionStatus<C>
- Returns:
- The connection status.
-
getTransactionDefinition
Description copied from interface:TransactionExecution
The transaction definition.- Specified by:
getTransactionDefinition
in interfaceTransactionExecution
- Returns:
- the transaction definition
-
getConnection
- Specified by:
getConnection
in interfaceReactiveTransactionStatus<C>
- Returns:
- The current connection.
-
isNewTransaction
public boolean isNewTransaction()Description copied from interface:TransactionExecution
Return whether the present transaction is new; otherwise participating in an existing transaction, or potentially not running in an actual transaction in the first place.- Specified by:
isNewTransaction
in interfaceTransactionExecution
- Returns:
- Whether the execution is a new transaction
-
setRollbackOnly
public void setRollbackOnly()Description copied from interface:TransactionExecution
Set the transaction rollback-only. This instructs the transaction manager that the only possible outcome of the transaction may be a rollback, as alternative to throwing an exception which would in turn trigger a rollback.- Specified by:
setRollbackOnly
in interfaceTransactionExecution
-
isRollbackOnly
public boolean isRollbackOnly()Description copied from interface:TransactionExecution
Return whether the transaction has been marked as rollback-only (either by the application or by the transaction infrastructure).- Specified by:
isRollbackOnly
in interfaceTransactionExecution
- Returns:
- Whether the execution has been marked to rollback
-
isCompleted
public boolean isCompleted()Description copied from interface:TransactionExecution
Return whether this transaction is completed, that is, whether it has already been committed or rolled back.- Specified by:
isCompleted
in interfaceTransactionExecution
- Returns:
- Whether the execution has completed
-