类 SimpleTransactionStatus
- java.lang.Object
- org.springframework.transaction.support.AbstractTransactionStatus
- org.springframework.transaction.support.SimpleTransactionStatus
- 所有已实现的接口:
Flushable
,SavepointManager
,TransactionStatus
public class SimpleTransactionStatus extends AbstractTransactionStatus
A simpleTransactionStatus
implementation. Derives fromAbstractTransactionStatus
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 mockPlatformTransactionManager
or as argument passed into aTransactionCallback
to be tested).- 从以下版本开始:
- 1.2.3
- 作者:
- Juergen Hoeller
- 另请参阅:
TransactionCallback.doInTransaction(org.springframework.transaction.TransactionStatus)
构造器概要
构造器 构造器 说明 SimpleTransactionStatus()
Create a newSimpleTransactionStatus
instance, indicating a new transaction.SimpleTransactionStatus(boolean newTransaction)
Create a newSimpleTransactionStatus
instance.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 boolean
isNewTransaction()
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 newSimpleTransactionStatus
instance, indicating a new transaction.
SimpleTransactionStatus
public SimpleTransactionStatus(boolean newTransaction)
Create a newSimpleTransactionStatus
instance.- 参数:
newTransaction
- whether to indicate a new transaction
方法详细资料
isNewTransaction
public boolean isNewTransaction()
从接口复制的说明:TransactionStatus
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.