org.springframework.transaction.TransactionStatus
interface, used by AbstractPlatformTransactionManager. Based on the concept
of an underlying "transaction object".
Holds all status information that AbstractPlatformTransactionManager
needs internally, including a generic transaction object determined by the
concrete transaction manager implementation.
Supports delegating savepoint-related methods to a transaction object
that implements the SavepointManager interface.
Note
This is not intended for use with other PlatformTransactionManager
implementations, in particular not for mock transaction managers in testing environments.
Use the alternative SimpleTransactionStatus class or a mock for the plain
org. interface instead.
AbstractPlatformTransactionManager, org.springframework.transaction.SavepointManager , getTransaction, createSavepoint, rollbackToSavepoint, releaseSavepoint, SimpleTransactionStatus
| Modifier and Type | Field and Description |
|---|---|
| private final boolean | |
| private final boolean | |
| private final boolean | |
| private final boolean | |
| private final boolean | |
| private final Object | |
| private final Object | |
| private final String |
| Access | Constructor and Description |
|---|---|
| public | DefaultTransactionStatus(String
the defined name of the transaction transactionName, Object underlying transaction object that can hold state
for the internal transaction implementation transaction, boolean if the transaction is new, otherwise participating
in an existing transaction newTransaction, boolean if a new transaction synchronization has been
opened for the given transaction newSynchronization, boolean nested, boolean whether the transaction is marked as read-only readOnly, boolean should debug logging be enabled for the handling of this transaction?
Caching it in here can prevent repeated calls to ask the logging system whether
debug logging should be enabled. debug, Object a holder for resources that have been suspended
for this transaction, if any suspendedResources)Create a new |
| public | DefaultTransactionStatus(Object transaction, boolean newTransaction, boolean newSynchronization, boolean readOnly, boolean debug, Object suspendedResources)
Deprecated
for removal since 6.1.
|
| Modifier and Type | Method and Description |
|---|---|
| public void | flush()
Overrides default org. SmartTransactionObject interface.
|
| protected SavepointManager | getSavepointManager()
Overrides org. SavepointManager interface
of the underlying transaction object, if any.
|
| public Object | getSuspendedResources()
Return the holder for resources that have been suspended for this transaction, if any. |
| public Object | |
| public String | getTransactionName()
Overrides default org. |
| public boolean | hasTransaction()
Overrides default org. false when not running in an actual transaction at all.
|
| public boolean | |
| public boolean | isGlobalRollbackOnly()
Overrides org. SmartTransactionObject interface.
|
| public boolean | isNested()
Overrides default org. |
| public boolean | isNewSynchronization()
Return if a new transaction synchronization has been opened for this transaction. |
| public boolean | isNewTransaction()
Overrides default org. |
| public boolean | isReadOnly()
Overrides default org. |
| public boolean | isTransactionSavepointManager()
Return whether the underlying transaction implements the |
| debug | back to summary |
|---|---|
| private final boolean debug | |
| nested | back to summary |
|---|---|
| private final boolean nested | |
| newSynchronization | back to summary |
|---|---|
| private final boolean newSynchronization | |
| newTransaction | back to summary |
|---|---|
| private final boolean newTransaction | |
| readOnly | back to summary |
|---|---|
| private final boolean readOnly | |
| suspendedResources | back to summary |
|---|---|
| private final Object suspendedResources
| |
| transaction | back to summary |
|---|---|
| private final Object transaction
| |
| transactionName | back to summary |
|---|---|
| private final String transactionName
| |
| DefaultTransactionStatus | back to summary |
|---|---|
| public DefaultTransactionStatus(String transactionName, Object transaction, boolean newTransaction, boolean newSynchronization, boolean nested, boolean readOnly, boolean debug, Object suspendedResources) Create a new
| |
| DefaultTransactionStatus | back to summary |
|---|---|
| public DefaultTransactionStatus(Object transaction, boolean newTransaction, boolean newSynchronization, boolean readOnly, boolean debug, Object suspendedResources)
Deprecated for removal since 6.1.
| |
| flush | back to summary |
|---|---|
| public void flush() Overrides default org. Delegate the flushing to the transaction object, provided that the latter
implements the
| |
| getSavepointManager | back to summary |
|---|---|
| protected SavepointManager getSavepointManager() Overrides org. This implementation exposes the
| |
| getSuspendedResources | back to summary |
|---|---|
| public Object getSuspendedResources() Return the holder for resources that have been suspended for this transaction, if any.
| |
| getTransaction | back to summary |
|---|---|
| public Object getTransaction() Return the underlying transaction object.
| |
| getTransactionName | back to summary |
|---|---|
| public String getTransactionName() Overrides default org. Doc from org. 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 boolean hasTransaction() Overrides default org. Doc from org. 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
| |
| isDebug | back to summary |
|---|---|
| public boolean isDebug() Return whether the progress of this transaction is debugged. This is used by
| |
| isGlobalRollbackOnly | back to summary |
|---|---|
| public boolean isGlobalRollbackOnly() Overrides org. Determine the rollback-only flag via checking the transaction object, provided
that the latter implements the Will return
| |
| isNested | back to summary |
|---|---|
| public boolean isNested() Overrides default org. Doc from org. Return if this transaction executes in a nested fashion within another. The default implementation returns
| |
| isNewSynchronization | back to summary |
|---|---|
| public boolean isNewSynchronization() Return if a new transaction synchronization has been opened for this transaction. | |
| isNewTransaction | back to summary |
|---|---|
| public boolean isNewTransaction() Overrides default org. Doc from org. 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 boolean isReadOnly() Overrides default org. Doc from org. Return if this transaction is defined as read-only transaction. The default implementation returns
| |
| isTransactionSavepointManager | back to summary |
|---|---|
| public boolean isTransactionSavepointManager() Return whether the underlying transaction implements the
| |