The Spring Framework

org.springframework.transaction.support
Class SimpleTransactionStatus

java.lang.Object
  extended by org.springframework.transaction.support.AbstractTransactionStatus
      extended by org.springframework.transaction.support.SimpleTransactionStatus
All Implemented Interfaces:
SavepointManager, TransactionStatus

public class SimpleTransactionStatus
extends AbstractTransactionStatus

A simple TransactionStatus implementation.

Derives from AbstractTransactionStatus and adds an explicit "newTransaction" flag.

This class is not used by any of Spring's pre-built PlatformTransactionManager implementations. It is mainly provided as a start for custom transaction manager implementations and as a static mock for testing transactional code (either as part of a mock PlatformTransactionManager or as argument passed into a TransactionCallback to be tested).

Since:
1.2.3
Author:
Juergen Hoeller
See Also:
SimpleTransactionStatus(boolean), TransactionCallback

Constructor Summary
SimpleTransactionStatus()
          Creates a new instance of the SimpleTransactionStatus class, indicating a new transaction.
SimpleTransactionStatus(boolean newTransaction)
          Creates a new instance of the SimpleTransactionStatus class.
 
Method Summary
 boolean isNewTransaction()
          Return whether the present transaction is new (else participating in an existing transaction, or potentially not running in an actual transaction in the first place).
 
Methods inherited from class org.springframework.transaction.support.AbstractTransactionStatus
createAndHoldSavepoint, createSavepoint, getSavepoint, getSavepointManager, hasSavepoint, isCompleted, isGlobalRollbackOnly, isLocalRollbackOnly, isRollbackOnly, releaseHeldSavepoint, releaseSavepoint, rollbackToHeldSavepoint, rollbackToSavepoint, setCompleted, setRollbackOnly, setSavepoint
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleTransactionStatus

public SimpleTransactionStatus()
Creates a new instance of the SimpleTransactionStatus class, indicating a new transaction.


SimpleTransactionStatus

public SimpleTransactionStatus(boolean newTransaction)
Creates a new instance of the SimpleTransactionStatus class.

Parameters:
newTransaction - whether to indicate a new transaction
Method Detail

isNewTransaction

public boolean isNewTransaction()
Description copied from interface: TransactionStatus
Return whether the present transaction is new (else participating in an existing transaction, or potentially not running in an actual transaction in the first place).


The Spring Framework

Copyright © 2002-2007 The Spring Framework.