Package io.micronaut.transaction.impl
Class DefaultTransactionStatus<C>
java.lang.Object
io.micronaut.transaction.impl.AbstractInternalTransaction<C>
io.micronaut.transaction.impl.DefaultTransactionStatus<C>
- Type Parameters:
C
- The connection type
- All Implemented Interfaces:
InternalTransaction<C>
,TransactionExecution
,TransactionStatus<C>
@Internal
public abstract sealed class DefaultTransactionStatus<C>
extends AbstractInternalTransaction<C>
implements InternalTransaction<C>
The default transaction status.
- Since:
- 4.0.0
- Author:
- Denis Stepanov
-
Field Summary
Fields inherited from class io.micronaut.transaction.impl.AbstractInternalTransaction
synchronizations
-
Method Summary
Modifier and TypeMethodDescriptionstatic <C> DefaultTransactionStatus<C>
existingTx
(ConnectionStatus<C> connectionStatus, DefaultTransactionStatus<C> existingTransaction) @Nullable Object
The transaction definition.static <C> DefaultTransactionStatus<C>
newTx
(ConnectionStatus<C> connectionStatus, TransactionDefinition definition) static <C> DefaultTransactionStatus<C>
noTx
(ConnectionStatus<C> connectionStatus, TransactionDefinition definition) void
setTransaction
(Object transaction) Sets the transaction representation object.Methods inherited from class io.micronaut.transaction.impl.AbstractInternalTransaction
cleanupAfterCompletion, isCompleted, isGlobalRollbackOnly, isLocalRollbackOnly, isRollbackOnly, registerSynchronization, setGlobalRollbackOnly, setRollbackOnly, triggerAfterCommit, triggerAfterCompletion, triggerBeforeCommit, triggerBeforeCompletion
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.impl.InternalTransaction
cleanupAfterCompletion, isGlobalRollbackOnly, isLocalRollbackOnly, resume, suspend, triggerAfterCommit, triggerAfterCompletion, triggerBeforeCommit, triggerBeforeCompletion
Methods inherited from interface io.micronaut.transaction.TransactionExecution
isCompleted, isNewTransaction, isRollbackOnly, setRollbackOnly
Methods inherited from interface io.micronaut.transaction.TransactionStatus
registerSynchronization
-
Field Details
-
connectionStatus
-
-
Method Details
-
newTx
public static <C> DefaultTransactionStatus<C> newTx(ConnectionStatus<C> connectionStatus, TransactionDefinition definition) -
noTx
public static <C> DefaultTransactionStatus<C> noTx(ConnectionStatus<C> connectionStatus, TransactionDefinition definition) -
existingTx
public static <C> DefaultTransactionStatus<C> existingTx(ConnectionStatus<C> connectionStatus, DefaultTransactionStatus<C> existingTransaction) -
setTransaction
Sets the transaction representation object.- Parameters:
transaction
- The transaction object
-
getTransaction
- Specified by:
getTransaction
in interfaceTransactionStatus<C>
- Returns:
- The underlying transaction object if exists.
-
getConnection
- Specified by:
getConnection
in interfaceTransactionStatus<C>
- Returns:
- The associated connection.
-
getConnectionStatus
- Specified by:
getConnectionStatus
in interfaceTransactionStatus<C>
- Returns:
- The connection status.
-
getTransactionDefinition
Description copied from interface:TransactionExecution
The transaction definition.- Specified by:
getTransactionDefinition
in interfaceTransactionExecution
- Returns:
- the transaction definition
-