|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.arsdigita.persistence.TransactionContext
Title: TransactionContext class This class is intentionally NOT threadsafe; it should not be shared across threads. Description: The TransactionContext class encapsulates a database transaction.
Method Summary | |
void |
abortTxn()
Aborts the current transaction. |
void |
addTransactionListener(TransactionListener listener)
Register a one time transaction event listener |
void |
beginTxn()
Begins a new transaction. |
void |
commitTxn()
Commits the current transaction. |
Object |
getAttribute(String name)
Get an attribute inside of this TransactionContext . |
int |
getTransactionIsolation()
Returns the isolation level of the current transaction. |
boolean |
inTxn()
Returns true if there is currently a transaction in progress. |
void |
removeAttribute(String name)
Remove an attribute from this TransactionContext . |
void |
removeTransactionListener(TransactionListener listener)
Unregister a transaction event listener. |
void |
setAttribute(String name,
Object value)
Set an attribute inside of this TransactionContext . |
void |
setTransactionIsolation(int level)
Sets the isolation level of the current transaction. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public void beginTxn()
public void commitTxn()
public void abortTxn()
public void addTransactionListener(TransactionListener listener)
public void removeTransactionListener(TransactionListener listener)
public boolean inTxn()
public int getTransactionIsolation()
public void setTransactionIsolation(int level)
level
- The desired isolation level.public void setAttribute(String name, Object value)
TransactionContext
. The
attribute will exist as long as the transaction is opened. When the
transaction is closed or aborted, the attribute will be discarded. This
method is analogous to ServletRequest.setAttribute(String, Object)
name
- the name of the attributevalue
- the value of the attributepublic Object getAttribute(String name)
TransactionContext
. The
attribute will exist as long as the transaction is opened. When the
transaction is closed or aborted, the attribute will be discarded. This
method is analogous to ServletRequest.getAttribute(String)
name
- the name of the attribute
public void removeAttribute(String name)
TransactionContext
. be
discarded. This method is analogous to ServletRequest.removeAttribute(String)
name
- the name of the attribute to remove
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |