TransactionStatus as well as
ReactiveTransaction, and as of 6.1 also as transaction
representation for TransactionExecutionListener.
| Modifier and Type | Method and Description |
|---|---|
| public default String | |
| public default boolean | hasTransaction()
Return whether there is an actual transaction active: this is meant to cover
a new transaction as well as participation in an existing transaction, only
returning |
| public default boolean | isCompleted()
Return whether this transaction is completed, that is, whether it has already been committed or rolled back. |
| public default boolean | |
| public default boolean | isNewTransaction()
Return whether the transaction manager considers the present transaction as new; otherwise participating in an existing transaction, or potentially not running in an actual transaction in the first place. |
| public default boolean | |
| public default boolean | isRollbackOnly()
Return whether the transaction has been marked as rollback-only (either by the application or by the transaction infrastructure). |
| public default void |
| getTransactionName | back to summary |
|---|---|
| public default String getTransactionName() Return the defined name of the transaction (possibly an empty String). In case of Spring's declarative transactions, the exposed name will be
the The default implementation returns an empty String.
| |
| hasTransaction | back to summary |
|---|---|
| public default boolean hasTransaction() Return whether there is an actual transaction active: this is meant to cover
a new transaction as well as participation in an existing transaction, only
returning The default implementation returns
| |
| isCompleted | back to summary |
|---|---|
| public default boolean isCompleted() Return whether this transaction is completed, that is, whether it has already been committed or rolled back. The default implementation returns | |
| isNested | back to summary |
|---|---|
| public default boolean isNested() Return if this transaction executes in a nested fashion within another. The default implementation returns
| |
| isNewTransaction | back to summary |
|---|---|
| public default boolean isNewTransaction() Return whether the transaction manager considers the present transaction as new; otherwise participating in an existing transaction, or potentially not running in an actual transaction in the first place. This is primarily here for transaction manager state handling.
Prefer the use of The "new" status can be transaction manager specific, e.g. returning
The default implementation returns | |
| isReadOnly | back to summary |
|---|---|
| public default boolean isReadOnly() Return if this transaction is defined as read-only transaction. The default implementation returns
| |
| isRollbackOnly | back to summary |
|---|---|
| public default boolean isRollbackOnly() Return whether the transaction has been marked as rollback-only (either by the application or by the transaction infrastructure). The default implementation returns
| |
| setRollbackOnly | back to summary |
|---|---|
| public default void setRollbackOnly() 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. The default implementation throws an UnsupportedOperationException.
| |