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
ConstructorsConstructorDescriptionDefaultReactiveTransactionStatus(ConnectionStatus<C> connectionStatus, boolean isNew, TransactionDefinition transactionDefinition) -
Method Summary
Modifier and TypeMethodDescriptionThe transaction definition.booleanReturn whether this transaction is completed, that is, whether it has already been committed or rolled back.booleanReturn whether the present transaction is new; otherwise participating in an existing transaction, or potentially not running in an actual transaction in the first place.booleanReturn whether the transaction has been marked as rollback-only (either by the application or by the transaction infrastructure).voidSet the transaction rollback-only.
-
Constructor Details
-
DefaultReactiveTransactionStatus
public DefaultReactiveTransactionStatus(ConnectionStatus<C> connectionStatus, boolean isNew, TransactionDefinition transactionDefinition)
-
-
Method Details
-
getConnectionStatus
- Specified by:
getConnectionStatusin interfaceReactiveTransactionStatus<C>- Returns:
- The connection status.
-
getTransactionDefinition
Description copied from interface:TransactionExecutionThe transaction definition.- Specified by:
getTransactionDefinitionin interfaceTransactionExecution- Returns:
- the transaction definition
-
getConnection
- Specified by:
getConnectionin interfaceReactiveTransactionStatus<C>- Returns:
- The current connection.
-
isNewTransaction
public boolean isNewTransaction()Description copied from interface:TransactionExecutionReturn 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:
isNewTransactionin interfaceTransactionExecution- Returns:
- Whether the execution is a new transaction
-
setRollbackOnly
public void setRollbackOnly()Description copied from interface:TransactionExecutionSet 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:
setRollbackOnlyin interfaceTransactionExecution
-
isRollbackOnly
public boolean isRollbackOnly()Description copied from interface:TransactionExecutionReturn whether the transaction has been marked as rollback-only (either by the application or by the transaction infrastructure).- Specified by:
isRollbackOnlyin interfaceTransactionExecution- Returns:
- Whether the execution has been marked to rollback
-
isCompleted
public boolean isCompleted()Description copied from interface:TransactionExecutionReturn whether this transaction is completed, that is, whether it has already been committed or rolled back.- Specified by:
isCompletedin interfaceTransactionExecution- Returns:
- Whether the execution has completed
-