|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This is an protocol for a Transaction. A Transaction is associated with one and only one session (a session serialises transactions) but may have be associated with one or more threads. A transaction can be in one three possible states.open, committed or closed. You can also begin, commit, abort or rollback a transaction (in this context abort and rollback are sematically identical since their is no support for savepoints). It also has a method called 'setRollbackOnly' which will force the transaction to be rolledback even if a commit is issued.
Method Summary | |
void |
abort()
Abort the current transaction. |
void |
begin()
Put the transaction in the open state. |
void |
commit()
Close the current transaction. |
TransactionContext |
getTransactionContext()
Return the transaction context assoicated with this transaction |
boolean |
isOpened()
Test if the transaction is opened. |
void |
rollback()
Rollback the current transaction. |
void |
setRollbackOnly(boolean status)
Set the transaction so that the only outcome is rollback. |
Method Detail |
public void begin() throws TransactionInProgressException
TransactionInProgressException
public void commit() throws TransactionNotInProgressException, TransactionException, DatabaseIOException
If the transaction is not currently opened then TransactionNotInProg- ressException is raised.
TransactionException
TransactionNotInProgressException
DatabaseIOException
public void abort() throws TransactionNotInProgressException, DatabaseIOException
TransactionNotInProgressException
DatabaseIOException
public void rollback() throws TransactionNotInProgressException, DatabaseIOException
TransactionNotInProgressException
DatabaseIOException
public void setRollbackOnly(boolean status) throws TransactionNotInProgressException
status
- true to set rollback only; false to
clear the rollback only flag
TransactionNotInProgressException
public boolean isOpened()
public TransactionContext getTransactionContext()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |