|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.transaction.support.AbstractTransactionStatus org.springframework.transaction.support.DefaultTransactionStatus
public class DefaultTransactionStatus
Default implementation of the TransactionStatus
interface, used by AbstractPlatformTransactionManager
. Based on the concept
of an underlying "transaction object".
Holds all status information that AbstractPlatformTransactionManager
needs internally, including a generic transaction object determined by the
concrete transaction manager implementation.
Supports delegating savepoint-related methods to a transaction object
that implements the SavepointManager
interface.
NOTE: This is not intended to be used for other
PlatformTransactionManager implementations, in particular not for
mock transaction managers. Use SimpleTransactionStatus
or
a mock for the plain TransactionStatus interface instead.
AbstractPlatformTransactionManager
,
SavepointManager
,
getTransaction()
,
AbstractTransactionStatus.createSavepoint()
,
AbstractTransactionStatus.rollbackToSavepoint(java.lang.Object)
,
AbstractTransactionStatus.releaseSavepoint(java.lang.Object)
,
SimpleTransactionStatus
Constructor Summary | |
---|---|
DefaultTransactionStatus(Object transaction,
boolean newTransaction,
boolean newSynchronization,
boolean readOnly,
boolean debug,
Object suspendedResources)
Create a new DefaultTransactionStatus instance. |
Method Summary | |
---|---|
protected SavepointManager |
getSavepointManager()
This implementation exposes the SavepointManager interface of the underlying transaction object, if any. |
Object |
getSuspendedResources()
Return the holder for resources that have been suspended for this transaction, if any. |
Object |
getTransaction()
Return the underlying transaction object. |
boolean |
hasTransaction()
Return whether there is an actual transaction active. |
boolean |
isDebug()
Return whether the progress of this transaction is debugged. |
boolean |
isGlobalRollbackOnly()
Determine the rollback-only flag via checking both the transaction object, provided that the latter implements the SmartTransactionObject interface. |
boolean |
isNewSynchronization()
Return if a new transaction synchronization has been opened for this transaction. |
boolean |
isNewTransaction()
Return whether the present transaction is new (else participating in an existing transaction). |
boolean |
isReadOnly()
Return if this transaction is defined as read-only transaction. |
boolean |
isTransactionSavepointManager()
Return whether the underlying transaction implements the SavepointManager interface. |
Methods inherited from class org.springframework.transaction.support.AbstractTransactionStatus |
---|
createAndHoldSavepoint, createSavepoint, getSavepoint, hasSavepoint, isCompleted, 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 |
---|
public DefaultTransactionStatus(Object transaction, boolean newTransaction, boolean newSynchronization, boolean readOnly, boolean debug, Object suspendedResources)
transaction
- underlying transaction object that can hold
state for the internal transaction implementationnewTransaction
- if the transaction is new,
else participating in an existing transactionnewSynchronization
- if a new transaction synchronization
has been opened for the given transactionreadOnly
- whether the transaction is read-onlydebug
- should debug logging be enabled for the handling of this transaction?
Caching it in here can prevent repeated calls to ask the logging system whether
debug logging should be enabled.suspendedResources
- a holder for resources that have been suspended
for this transaction, if anyMethod Detail |
---|
public Object getTransaction()
public boolean hasTransaction()
public boolean isNewTransaction()
TransactionStatus
public boolean isNewSynchronization()
public boolean isReadOnly()
public boolean isDebug()
public Object getSuspendedResources()
public boolean isGlobalRollbackOnly()
Will return "true" if the transaction itself has been marked rollback-only by the transaction coordinator, for example in case of a timeout.
isGlobalRollbackOnly
in class AbstractTransactionStatus
protected SavepointManager getSavepointManager()
getSavepointManager
in class AbstractTransactionStatus
public boolean isTransactionSavepointManager()
getTransaction()
,
SavepointManager
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |