public class SimpleTransactionStatus extends AbstractTransactionStatus
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).
TransactionCallback.doInTransaction(org.springframework.transaction.TransactionStatus)
Constructor and Description |
---|
SimpleTransactionStatus()
Create a new
SimpleTransactionStatus instance,
indicating a new transaction. |
SimpleTransactionStatus(boolean newTransaction)
Create a new
SimpleTransactionStatus instance. |
Modifier and Type | Method and Description |
---|---|
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.
|
createAndHoldSavepoint, createSavepoint, flush, getSavepoint, getSavepointManager, hasSavepoint, isCompleted, isGlobalRollbackOnly, isLocalRollbackOnly, isRollbackOnly, releaseHeldSavepoint, releaseSavepoint, rollbackToHeldSavepoint, rollbackToSavepoint, setCompleted, setRollbackOnly, setSavepoint
public SimpleTransactionStatus()
SimpleTransactionStatus
instance,
indicating a new transaction.public SimpleTransactionStatus(boolean newTransaction)
SimpleTransactionStatus
instance.newTransaction
- whether to indicate a new transactionpublic boolean isNewTransaction()
TransactionStatus