com.interface21.transaction
Class TransactionStatus
java.lang.Object
|
+--com.interface21.transaction.TransactionStatus
- public class TransactionStatus
- extends java.lang.Object
Representation of the status of a transaction,
consisting of a transaction object and some status flags.
Transactional code can use this to retrieve status information
and to programatically request a rollback (instead of throwing
an exception that causes an implicit rollback).
- Since:
- 27.03.2003
- Author:
- Juergen Hoeller
- See Also:
PlatformTransactionManager,
TransactionCallback
|
Constructor Summary |
TransactionStatus(java.lang.Object transaction,
boolean newTransaction)
Create a new TransactionStatus instance. |
|
Method Summary |
java.lang.Object |
getTransaction()
Return the underlying transaction object, e.g. a JTA UserTransaction. |
boolean |
isNewTransaction()
Return if the transaction is new,
else participating in a surrounding transaction. |
boolean |
isRollbackOnly()
Return if the transaction has been set rollback-only. |
void |
setRollbackOnly()
Set the transaction rollback-only. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TransactionStatus
public TransactionStatus(java.lang.Object transaction,
boolean newTransaction)
- Create a new TransactionStatus instance.
- Parameters:
transaction - underlying transaction object,
e.g. a JTA UserTransactionnewTransaction - if the transaction is new,
else participating in a surrounding transaction
getTransaction
public java.lang.Object getTransaction()
- Return the underlying transaction object, e.g. a JTA UserTransaction.
isNewTransaction
public boolean isNewTransaction()
- Return if the transaction is new,
else participating in a surrounding transaction.
isRollbackOnly
public boolean isRollbackOnly()
- Return if the transaction has been set rollback-only.
setRollbackOnly
public void setRollbackOnly()
- Set the transaction rollback-only.
Rod Johnson and Spring contributors 2001-2003.