Class TSXaTransaction

java.lang.Object
com.sun.ts.tests.common.connector.whitebox.TSXaTransaction

public class TSXaTransaction extends Object
Class representing one Global Transaction.
Version:
1.0, 06/06/02
Author:
Binod P.G
  • Constructor Details

    • TSXaTransaction

      public TSXaTransaction(Xid id)
      Creates a new Global Transaction object.
      Parameters:
      id - Global Transaction Identifier.
  • Method Details

    • addConnection

      public void addConnection(TSConnection con)
      Adds the connection to this transaction.
      Parameters:
      con - Connection involved in the transaction branch.
    • setStatus

      public void setStatus(int status)
      Sets the Status of the transaction.
      Parameters:
      Status - of the transaction
    • getStatus

      public int getStatus()
      Get the status of the transaction.
      Returns:
      Status of the transaction.
    • prepare

      public int prepare() throws XAException
      Prepare the transaction.
      Returns:
      The Vote of this branch in this transaction.
      Throws:
      XAException - If prepare fails.
    • commit

      public void commit(boolean onePhase) throws XAException
      Commits this Transaction.
      Parameters:
      Boolean - indicating, whether it is a single-phase or 2-phase commit.
      Throws:
      XAException - If commit fails.
    • rollback

      public void rollback()
      Rolls back the transaction
    • read

      public DataElement read(String elementkey) throws TSEISException
      Check for the key in the transaction. If it is not readable return null.
      Parameters:
      elementkey - Key to be read.
      Returns:
      DataElement object.
      Throws:
      TSEISException - In case, read fails.