de.uplanet.server.transaction
Class TransactionManager

java.lang.Object
  extended by de.uplanet.server.transaction.TransactionManager

@Scriptable
public final class TransactionManager
extends java.lang.Object

Version:
$Revision: 86609 $

Constructor Summary
TransactionManager()
           
 
Method Summary
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()
           
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()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TransactionManager

public TransactionManager()
Method Detail

getInstance

@Deprecated
public static TransactionManager getInstance()
Deprecated. Call the static methods directly.

Returns:
A new instance of TransactionManager.

begin

public static void begin()
Starts the transaction associated to the current thread. Creates an transaction object, if none is created for the current thread right now. This method ignores a multiple begin call, and writes a log entry in this case.

Throws:
java.lang.Exception

commit

public static void commit()
                   throws de.uplanet.server.transaction.TransactionManagerException
Commits the transaction associated with the current thread. After this call no transaction object is associated with the thread anymore.

Throws:
TransactionManagerException

rollback

public static void rollback()
                     throws de.uplanet.server.transaction.TransactionManagerException
Rollbacks the transaction of the current thread. After this call no transaction object is associated with the thread anymore.

Throws:
TransactionManagerException

end

public static void end()
                throws de.uplanet.server.transaction.TransactionManagerException
Throws:
de.uplanet.server.transaction.TransactionManagerException

hasTransaction

public static boolean hasTransaction()
Check if the current thread has a transaction.

Returns:
true if the current threads has a transaction, or false otherwise.

getTransaction

public static ITransaction getTransaction()
Returns the transaction for the current thread

Returns:
The current transaction or null if no transaction was set.

setRollbackOnly

public static void setRollbackOnly()


Last updated: 2011-08-11 10-04
Copyright © 2000-2011 United Planet. All Rights Reserved.