Overview | Package | Class | Use | Tree | Deprecated | Index | Help
|  | BEA Systems, Inc.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## BEA WebLogic Server 9.0 API Reference

## weblogic.transaction
Class TxHelper

    java.lang.Object
      weblogic.transaction.TxHelper

public class TxHelper
extends Object

This class is a convenience wrapper for gaining access to objects and resources related to the transaction manager, on both client and server processes, via static methods. Some of these methods are deprecated and TransactionHelper should be used instead.

  Copyright © 2005 BEA Systems, Inc. All Rights Reserved.

Constructor Summary
`TxHelper()`

Method Summary
`static Xid` | `createXid(byte[] aGlobalTransactionId, byte[] aBranchQualifier)` Create an Xid object, assuming global transaction identifier is in internal format of weblogic's transaction manager.
`static Xid` | `createXid(int aFormatId, byte[] aGlobalTransactionId, byte[] aBranchQualifier)` Create an Xid object, given its public attributes.
`static InterposedTransactionManager` | `getClientInterposedTransactionManager(Context initialContext, String serverName)` Client-side gateway implementors should use this method to obtain the `InterposedTransactionManager` interface of the Client transaction manager that corresponds to a particular server's transaction manager to import foreign transactions into WLS.
`static ClientTransactionManager` | `getClientTransactionManager()` Deprecated.
`static InterposedTransactionManager` | `getServerInterposedTransactionManager()` Server-side gateway implementors should use this method to obtain the `InterposedTransactionManager` interface of the local singleton Server transaction manager to import foreign transactions into WLS.
`static Transaction` | `getTransaction()` Deprecated.
`static TransactionManager` | `getTransactionManager()` Gets a reference to the singleton, server-side `TransactionManager` object.
`static UserTransaction` | `getUserTransaction()` Deprecated.
`static String` | `status2String(int status)` Translates `javax.transaction.Status` constants to English strings.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### TxHelper

    public TxHelper()

Method Detail

### createXid

    public static Xid createXid(byte[] aGlobalTransactionId,
                                byte[] aBranchQualifier)

  Create an Xid object, assuming global transaction identifier is in internal format of weblogic's transaction manager.

  Parameters:
    `aGlobalTransactionId` - Global transation identifier
    `aBranchQualifier` - Branch qualifier (optional)
  Returns:
    An Xid object or null

### createXid

    public static Xid createXid(int aFormatId,
                                byte[] aGlobalTransactionId,
                                byte[] aBranchQualifier)

  Create an Xid object, given its public attributes.

  Parameters:
    `aFormatId` - Format identifier
    `aGlobalTransactionId` - Global transation identifier
    `aBranchQualifier` - Branch qualifier
  Returns:
    An Xid object or null

### getClientInterposedTransactionManager

    public static InterposedTransactionManager getClientInterposedTransactionManager(Context initialContext,
                                                                                     String serverName)

  Client-side gateway implementors should use this method to obtain the `InterposedTransactionManager` interface of the Client transaction manager that corresponds to a particular server's transaction manager to import foreign transactions into WLS. Foreign transactions imported into WLS through this Client transaction manager will be coordinated by the specified server internally.

  If the initial context is obtained from a non-clustered server, then the server name specified should refer to the same server. If the initial context is obtained from a cluster, then the server name specified should refer to a server within the cluster.

  Note that this method returns `null` on any errors. If clients are interested in getting the exceptions thrown when obtaining the `InterposedTransactionManager`, they could perform JNDI lookup for the following path from the initial context directly: weblogic.transaction.coordinators.

  Note that even though it is possible to cast the `TransactionManager` instance obtained from `getTransactionManager` to a `InterposedTransactionManager` instance, but doing so is strongly discouraged. This is because the Client transaction manager singleton instance returned by `getTransactionManager` may not be associated with any server, and cannot import transactions.

  Parameters:
    `serverName` - The name of the server
  Returns:
    The InterposedTransactionManager interface of the Client transaction manager that corresponds to the specified server's transaction manager. Returns null on any error.
  See Also:
    `InterposedTransactionManager`

### getClientTransactionManager

    public static ClientTransactionManager getClientTransactionManager()

  Deprecated.

  See Also:
    `TransactionHelper.getTransactionManager()`

### getServerInterposedTransactionManager

    public static InterposedTransactionManager getServerInterposedTransactionManager()

  Server-side gateway implementors should use this method to obtain the `InterposedTransactionManager` interface of the local singleton Server transaction manager to import foreign transactions into WLS. This local singleton Server transaction manager will also internally coordinate all foreign transactions imported through it.

  Returns:
    The InterposedTransactionManager interface of the singleton Server transaction manager
  See Also:
    `InterposedTransactionManager`

### getTransaction

    public static Transaction getTransaction()

  Deprecated.

  See Also:
    `TransactionHelper.getTransaction()`

### getTransactionManager

    public static TransactionManager getTransactionManager()

  Gets a reference to the singleton, server-side `TransactionManager` object. Callers expecting consistent behavior between server, fat-client and thin-client should use `ClientTransactionManager` via `TransactionHelper`.

  See Also:
    `TransactionHelper.getTransactionManager()`

### getUserTransaction

    public static UserTransaction getUserTransaction()

  Deprecated.

  See Also:
    `TransactionHelper.getUserTransaction()`

### status2String

    public static String status2String(int status)

  Translates `javax.transaction.Status` constants to English strings.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Documentation is available at http://e-docs.bea.com/wls/docs90 Copyright 2005 BEA Systems Inc.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD