java.lang.Object | |
↳ | org.springframework.transaction.support.AbstractTransactionStatus |
Known Direct Subclasses |
Abstract base implementation of the
TransactionStatus
interface.
Pre-implements the handling of local rollback-only and completed flags, and
delegation to an underlying SavepointManager
.
Also offers the option of a holding a savepoint within the transaction.
Does not assume any specific internal transaction handling, such as an underlying transaction object, and no transaction synchronization mechanism.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Create a savepoint and hold it for the transaction.
| |||||||||||
This implementation delegates to a SavepointManager for the
underlying transaction, if possible.
| |||||||||||
This implementations is empty, considering flush as a no-op.
| |||||||||||
Return whether this transaction internally carries a savepoint,
that is, has been created as nested transaction based on a savepoint.
| |||||||||||
Return whether this transaction is completed, that is,
whether it has already been committed or rolled back.
| |||||||||||
Template method for determining the global rollback-only flag of the
underlying transaction, if any.
| |||||||||||
Determine the rollback-only flag via checking this TransactionStatus.
| |||||||||||
Determine the rollback-only flag via checking both the local rollback-only flag
of this TransactionStatus and the global rollback-only flag of the underlying
transaction, if any.
| |||||||||||
Release the savepoint that is held for the transaction.
| |||||||||||
This implementation delegates to a SavepointManager for the
underlying transaction, if possible.
| |||||||||||
Roll back to the savepoint that is held for the transaction.
| |||||||||||
This implementation delegates to a SavepointManager for the
underlying transaction, if possible.
| |||||||||||
Mark this transaction as completed, that is, committed or rolled back.
| |||||||||||
Set the transaction rollback-only.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Get the savepoint for this transaction, if any.
| |||||||||||
Return a SavepointManager for the underlying transaction, if possible.
| |||||||||||
Set a savepoint for this transaction.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
org.springframework.transaction.SavepointManager
| |||||||||||
From interface
org.springframework.transaction.TransactionStatus
|
Create a savepoint and hold it for the transaction.
NestedTransactionNotSupportedException | if the underlying transaction does not support savepoints |
---|---|
TransactionException |
This implementation delegates to a SavepointManager for the underlying transaction, if possible.
TransactionException |
---|
This implementations is empty, considering flush as a no-op.
Return whether this transaction internally carries a savepoint, that is, has been created as nested transaction based on a savepoint.
This method is mainly here for diagnostic purposes, alongside
isNewTransaction()
. For programmatic handling of custom
savepoints, use SavepointManager's operations.
Return whether this transaction is completed, that is, whether it has already been committed or rolled back.
Template method for determining the global rollback-only flag of the underlying transaction, if any.
This implementation always returns false
.
Determine the rollback-only flag via checking this TransactionStatus.
Will only return "true" if the application called setRollbackOnly
on this TransactionStatus object.
Determine the rollback-only flag via checking both the local rollback-only flag of this TransactionStatus and the global rollback-only flag of the underlying transaction, if any.
Release the savepoint that is held for the transaction.
TransactionException |
---|
This implementation delegates to a SavepointManager for the underlying transaction, if possible.
savepoint | the savepoint to release |
---|
TransactionException |
---|
Roll back to the savepoint that is held for the transaction.
TransactionException |
---|
This implementation delegates to a SavepointManager for the underlying transaction, if possible.
savepoint | the savepoint to roll back to |
---|
org.springframework.transaction.NestedTransactionNotSupportedException | |
TransactionException |
Mark this transaction as completed, that is, committed or rolled back.
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.
This is mainly intended for transactions managed by
TransactionTemplate
or
TransactionInterceptor
,
where the actual commit/rollback decision is made by the container.
Return a SavepointManager for the underlying transaction, if possible.
Default implementation always throws a NestedTransactionNotSupportedException.
NestedTransactionNotSupportedException | if the underlying transaction does not support savepoints |
---|
Set a savepoint for this transaction. Useful for PROPAGATION_NESTED.