org.springframework.transaction.TransactionStatus
implementation. Derives from AbstractTransactionStatus and
adds an explicit "newTransaction" flag.
This class is not used by any of Spring's pre-built
org.
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
| Modifier and Type | Field and Description |
|---|---|
| private final boolean |
| Access | Constructor and Description |
|---|---|
| public | SimpleTransactionStatus()
Create a new |
| public | SimpleTransactionStatus(boolean
whether to indicate a new transaction newTransaction)Create a new |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | isNewTransaction()
Overrides default org. |
| newTransaction | back to summary |
|---|---|
| private final boolean newTransaction | |
| SimpleTransactionStatus | back to summary |
|---|---|
| public SimpleTransactionStatus() Create a new | |
| SimpleTransactionStatus | back to summary |
|---|---|
| public SimpleTransactionStatus(boolean newTransaction) Create a new
| |
| isNewTransaction | back to summary |
|---|---|
| public boolean isNewTransaction() Overrides default org. Doc from org. Return whether the transaction manager considers the present transaction as new; otherwise participating in an existing transaction, or potentially not running in an actual transaction in the first place. This is primarily here for transaction manager state handling.
Prefer the use of The "new" status can be transaction manager specific, e.g. returning
The default implementation returns
| |