xl2.transaction
Class TransactionMgr
java.lang.Object
|
+--xl2.transaction.TransactionMgr
- public class TransactionMgr
- extends java.lang.Object
Provides static access to threads' transactions.
Method Summary |
static void |
abort()
Calls abort on the current transaction. |
static void |
begin()
Calls begin on the current transaction. |
static void |
commit()
Calls commit on the current transaction. |
static Transaction |
currentTransaction()
The transaction of the calling thread. |
static Transaction |
getGlobal()
The default transaction for any thread not explicitly joined to one. |
static void |
setGlobal(Transaction trans)
If currentTransaction() can not find a transaction for the calling
thread, it will return the transaction specified here. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TransactionMgr
public TransactionMgr()
abort
public static void abort()
- Calls abort on the current transaction.
- Throws:
TransactionRequiredException
- If the calling thread is not joined
to a transaction and there is no global transaction.- See Also:
Transaction.abort()
begin
public static void begin()
- Calls begin on the current transaction.
- Throws:
TransactionRequiredException
- If the calling thread is not joined
to a transaction and there is no global transaction.- See Also:
Transaction.begin()
commit
public static void commit()
- Calls commit on the current transaction.
- Throws:
TransactionRequiredException
- If the calling thread is not joined
to a transaction and there is no global transaction.- See Also:
Transaction.commit()
currentTransaction
public static Transaction currentTransaction()
- The transaction of the calling thread. If the calling thread
has not joined any transactions, the global transaction is returned.
- Returns:
- Possibly null.
- See Also:
getGlobal()
getGlobal
public static Transaction getGlobal()
- The default transaction for any thread not explicitly joined to one.
- Returns:
- Possibly null.
- See Also:
setGlobal(Transaction)
setGlobal
public static void setGlobal(Transaction trans)
- If currentTransaction() can not find a transaction for the calling
thread, it will return the transaction specified here.
- Parameters:
trans
- The default transaction, if there is one.