@Scriptable
public final class TransactionManager
extends java.lang.Object
Constructor and Description |
---|
TransactionManager() |
Modifier and Type | Method and Description |
---|---|
static void |
addAfterCommitAction(de.uplanet.server.transaction.IAfterCommitAction p_action)
Add an action to the current transaction that will be performed
after the transaction has been committed.
|
static void |
begin()
Starts the transaction associated to the current thread.
|
static void |
commit()
Commits the transaction associated with the current thread.
|
static void |
end()
Complete the current transaction, i.e.
|
static TransactionManager |
getInstance()
Deprecated.
Call the static methods directly.
|
static ITransaction |
getTransaction()
Returns the transaction for the current thread.
|
static boolean |
hasTransaction()
Check if the current thread has a transaction.
|
static void |
rollback()
Rollbacks the transaction of the current thread.
|
static void |
setRollbackOnly()
Put the current transaction into the rollback mode, such
that calling
end() will rollback the transaction. |
@Deprecated public static TransactionManager getInstance()
TransactionManager
.public static void begin()
java.lang.Exception
public static void commit() throws de.uplanet.server.transaction.TransactionManagerException
TransactionManagerException
public static void rollback() throws de.uplanet.server.transaction.TransactionManagerException
TransactionManagerException
public static void end() throws de.uplanet.server.transaction.TransactionManagerException
commit()
if setRollbackOnly()
has not been called, orrollback()
if setRollbackOnly()
has been calledTransactionManagerException
public static boolean hasTransaction()
true
if the current threads has a transaction,
or false
otherwise.public static ITransaction getTransaction()
null
if no transaction was set.public static void setRollbackOnly()
end()
will rollback the transaction.public static void addAfterCommitAction(de.uplanet.server.transaction.IAfterCommitAction p_action)
Note: This method must not be called if hasTransaction()
is false
.
p_action
- The action to be performed after commit.java.lang.IllegalStateException
- If the method is being called while
hasTransaction()
is false
.