Class DefaultTransactionStatus

java.lang.Object
org.springframework.transaction.support.AbstractTransactionStatus
org.springframework.transaction.support.DefaultTransactionStatus
All Implemented Interfaces:
Flushable, SavepointManager, TransactionExecution, TransactionStatus

public class DefaultTransactionStatus extends AbstractTransactionStatus
Default implementation of the 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 TransactionStatus interface instead.

Since:
19.01.2004
Author:
Juergen Hoeller
See Also:
  • Constructor Details

    • DefaultTransactionStatus

      public DefaultTransactionStatus(@Nullable String transactionName, @Nullable Object transaction, boolean newTransaction, boolean newSynchronization, boolean nested, boolean readOnly, boolean debug, @Nullable Object suspendedResources)
      Create a new DefaultTransactionStatus instance.
      Parameters:
      transactionName - the defined name of the transaction
      transaction - underlying transaction object that can hold state for the internal transaction implementation
      newTransaction - if the transaction is new, otherwise participating in an existing transaction
      newSynchronization - if a new transaction synchronization has been opened for the given transaction
      readOnly - whether the transaction is marked as read-only
      debug - 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.
      suspendedResources - a holder for resources that have been suspended for this transaction, if any
      Since:
      6.1
  • Method Details