|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectwt.pom.Transaction
public class Transaction
Transaction provides interfaces to create transaction blocks. This class supports transaction block nesting. A new database level transaction is not started for nested transaction blocks. Internal state is maintained so that only a commit at the outer most transaction block will cause a database level commit. A rollback at any level will cause the entire transaction to be rolled back immediately.
TransactionListeners can be added within a global or local scope. For global
listeners, callback methods will be executed when the outer-most Transaction
either commits or rolls back. For the local listeners, the methods will be
called when this Transaction instance either commits or rolls back. The
overall transactional behavior is not affected.
Supported API: true
Extendable: false
TransactionListener| Constructor Summary | |
|---|---|
Transaction()
This constructor initializes the instance. |
|
Transaction(LocalizableMessage a_description)
This constructor initializes the instance. |
|
| Method Summary | |
|---|---|
void |
addLocalTransactionListener(TransactionListener a_listener)
Add a listener for local Transaction events. |
static void |
addTransactionListener(TransactionListener listener)
Add a listener for Transaction events. |
void |
commit()
Commit a transaction block. |
static boolean |
containsKeyInContext(Object a_key,
boolean a_includeGlobalMap,
boolean a_includeMethodContext)
Indicates if the key exists in the current context of the Transaction. |
static List |
findAllInContext(Object a_key)
Returns List of Transactions that contains the specified key. |
static Transaction |
findInContext(Object a_key)
Returns the inner-most Transaction in the current Transaction stack that contains the specified key. |
static Transaction |
getCurrentTransaction()
Returns the current Transaction. |
LocalizableMessage |
getDescription()
Returns the transaction description. |
static Map |
getGlobalMap()
Returns the global transaction map. |
static Object |
getInContext(Object a_key,
boolean a_includeGlobalMap,
boolean a_includeMethodContext)
Returns the values associated with the specified key exists in the current context of the Transaction. |
Map |
getLocalMap()
Returns the local transaction map. |
static List |
getTransactionStack()
Returns the current Transaction stack. |
boolean |
hasLocalMap()
Indicates if the Transaction has a local map. |
void |
removeLocalTransactionListener(TransactionListener listener)
Remove a listener for Transaction events. |
static void |
removeTransactionListener(TransactionListener listener)
Remove a listener for Transaction events. |
void |
rollback()
Rollback a transaction block. |
void |
start()
Start a transaction block. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Transaction()
public Transaction(LocalizableMessage a_description)
throws PersistenceException
a_description - localizable message describing this transaction. The
object must implement Evolvable.
PersistenceExceptionEvolvable| Method Detail |
|---|
public static boolean containsKeyInContext(Object a_key,
boolean a_includeGlobalMap,
boolean a_includeMethodContext)
throws WTException
WTException
public static Object getInContext(Object a_key,
boolean a_includeGlobalMap,
boolean a_includeMethodContext)
throws WTException
WTException
public static Transaction findInContext(Object a_key)
throws WTException
WTException
public static List findAllInContext(Object a_key)
throws WTException
WTException
public static List getTransactionStack()
throws WTException
WTException
public static Transaction getCurrentTransaction()
throws WTException
WTException
public static Map getGlobalMap()
throws WTException
WTException
public static void addTransactionListener(TransactionListener listener)
throws PersistenceException
PersistenceException
public static void removeTransactionListener(TransactionListener listener)
throws PersistenceException
PersistenceExceptionpublic LocalizableMessage getDescription()
public boolean hasLocalMap()
public Map getLocalMap()
public void start()
throws PersistenceException
PersistenceException
public void commit()
throws PersistenceException
PersistenceExceptionpublic void rollback()
public void addLocalTransactionListener(TransactionListener a_listener)
throws PersistenceException
PersistenceException
public void removeLocalTransactionListener(TransactionListener listener)
throws PersistenceException
PersistenceException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||