类 SimpleTransactionStatus
- java.lang.Object
- org.springframework.transaction.support.AbstractTransactionStatus
- org.springframework.transaction.support.SimpleTransactionStatus
- 所有已实现的接口:
Flushable,SavepointManager,TransactionStatus
public class SimpleTransactionStatus extends AbstractTransactionStatus
A simpleTransactionStatusimplementation. Derives fromAbstractTransactionStatusand adds an explicit"newTransaction"flag.This class is not used by any of Spring's pre-built
PlatformTransactionManagerimplementations. 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 mockPlatformTransactionManageror as argument passed into aTransactionCallbackto be tested).- 从以下版本开始:
- 1.2.3
- 作者:
- Juergen Hoeller
- 另请参阅:
TransactionCallback.doInTransaction(org.springframework.transaction.TransactionStatus)
构造器概要
构造器 构造器 说明 SimpleTransactionStatus()Create a newSimpleTransactionStatusinstance, indicating a new transaction.SimpleTransactionStatus(boolean newTransaction)Create a newSimpleTransactionStatusinstance.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 booleanisNewTransaction()Return whether the present transaction is new; otherwise participating in an existing transaction, or potentially not running in an actual transaction in the first place.从类继承的方法 org.springframework.transaction.support.AbstractTransactionStatus
createAndHoldSavepoint, createSavepoint, flush, getSavepoint, getSavepointManager, hasSavepoint, isCompleted, isGlobalRollbackOnly, isLocalRollbackOnly, isRollbackOnly, releaseHeldSavepoint, releaseSavepoint, rollbackToHeldSavepoint, rollbackToSavepoint, setCompleted, setRollbackOnly, setSavepoint
构造器详细资料
SimpleTransactionStatus
public SimpleTransactionStatus()
Create a newSimpleTransactionStatusinstance, indicating a new transaction.
SimpleTransactionStatus
public SimpleTransactionStatus(boolean newTransaction)
Create a newSimpleTransactionStatusinstance.- 参数:
newTransaction- whether to indicate a new transaction
方法详细资料
isNewTransaction
public boolean isNewTransaction()
从接口复制的说明:TransactionStatusReturn whether the present transaction is new; otherwise participating in an existing transaction, or potentially not running in an actual transaction in the first place.