org.springframework.transaction
Interface TransactionStatus

All Known Implementing Classes:
DefaultTransactionStatus

public interface TransactionStatus

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 programmatically request a rollback (instead of throwing an exception that causes an implicit rollback).

Since:
27.03.2003
Version:
$Id: TransactionStatus.java,v 1.5 2004/03/18 02:46:10 trisberg Exp $
Author:
Juergen Hoeller
See Also:
PlatformTransactionManager, TransactionCallback.doInTransaction(org.springframework.transaction.TransactionStatus), TransactionInterceptor.currentTransactionStatus(), setRollbackOnly()

Method Summary
 boolean isNewTransaction()
          Return if the transaction is new, else participating in an existing transaction.
 boolean isRollbackOnly()
          Return if the transaction has been set rollback-only.
 void setRollbackOnly()
          Set the transaction rollback-only.
 

Method Detail

isNewTransaction

public boolean isNewTransaction()
Return if the transaction is new, else participating in an existing transaction.


setRollbackOnly

public void setRollbackOnly()
Set the transaction rollback-only. This instructs the transaction manager that the only possible outcome of the transaction may be a rollback, proceeding with the normal applicaiton workflow though (i.e. no exception).

For transactions managed by TransactionTemplate or TransactionInterceptor. An alternative way to trigger a rollback is throwing an application exception.

See Also:
TransactionCallback.doInTransaction(org.springframework.transaction.TransactionStatus), TransactionAttribute.rollbackOn(java.lang.Throwable)

isRollbackOnly

public boolean isRollbackOnly()
Return if the transaction has been set rollback-only.



Copyright (C) 2003-2004 The Spring Framework Project.