Klasse TransactionManager

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

@Scriptable public final class TransactionManager extends Object
  • Konstruktorübersicht

    Konstruktoren
    Konstruktor
    Beschreibung
     
  • Methodenübersicht

    Modifizierer und Typ
    Methode
    Beschreibung
    static void
    Add an action to the current transaction that will be performed after the transaction has been committed.
    static void
    Starts the transaction associated to the current thread.
    static void
    Commits the transaction associated with the current thread.
    static void
    end()
    Complete the current transaction, i.e.
    Veraltet.
    Call the static methods directly.
    Returns the transaction for the current thread.
    static boolean
    Check if the current thread has a transaction.
    static void
    Rollbacks the transaction of the current thread.
    static void
    Put the current transaction into the rollback mode, such that calling end() will rollback the transaction.

    Von Klasse geerbte Methoden java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Konstruktordetails

    • TransactionManager

      public TransactionManager()
  • Methodendetails

    • getInstance

      @Deprecated public static TransactionManager getInstance()
      Veraltet.
      Call the static methods directly.
      Gibt zurück:
      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 calls, and writes a log entry in this case.
    • 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.
      Löst aus:
      de.uplanet.server.transaction.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.
      Löst aus:
      de.uplanet.server.transaction.TransactionManagerException
    • end

      public static void end() throws de.uplanet.server.transaction.TransactionManagerException
      Complete the current transaction, i.e. for the current transaction.
      Löst aus:
      de.uplanet.server.transaction.TransactionManagerException
    • hasTransaction

      public static boolean hasTransaction()
      Check if the current thread has a transaction.
      Gibt zurück:
      true if the current threads has a transaction, or false otherwise.
    • getTransaction

      public static ITransaction getTransaction()
      Returns the transaction for the current thread.
      Gibt zurück:
      The current transaction or null if no transaction was set.
    • setRollbackOnly

      public static void setRollbackOnly()
      Put the current transaction into the rollback mode, such that calling end() will rollback the transaction.
    • addAfterCommitAction

      public static void addAfterCommitAction(IAfterCommitAction p_action)
      Add an action to the current transaction that will be performed after the transaction has been committed.

      Note: This method must not be called if hasTransaction() is false.

      Parameter:
      p_action - The action to be performed after commit.
      Löst aus:
      IllegalStateException - If the method is being called while hasTransaction() is false.