tyrex.tm.impl

Class OracleXAResourceHelper

public final class OracleXAResourceHelper extends XAResourceHelper

This class describes various methods to help the transaction manipulate XA resources from Oracle. This class has been tested with Oracle 8.1.6, 8.1.7, 9.0.1.

Author: Riad Mohammed

Field Summary
static StringXID_CLASS_NAME
The name of the XID implementation class required by Oracle 8.1.6.
Constructor Summary
OracleXAResourceHelper()
Default constructor
Method Summary
StringgetXAErrorString(XAException xaException)
Return the oracle error code as a string if the exception is _oracleXAExceptionClassName otherwise return null.
XidgetXid(XAResource xaResource, Xid xid)
Create the xid for use with the XA resource from the specified xid.
booleantreatDifferentBranchesForSharedResourcesAsShared()
Return true if shared xa resources can be treated as shared even if they use different branches so that these xa resources are not prepared/committed separately even if they don't have the same xid.
booleanuseDifferentBranchesForSharedResources()
Return true if shared xa resources must use different branches when enlisted in the transaction.The resource may still be treated as shared in that prepare/commit is only called once on a single xa resource (@see #treatDifferentBranchesForSharedResourcesAsShared}).

Field Detail

XID_CLASS_NAME

public static final String XID_CLASS_NAME
The name of the XID implementation class required by Oracle 8.1.6. The value is "oracle.jdbc.xa.OracleXid".

Constructor Detail

OracleXAResourceHelper

public OracleXAResourceHelper()
Default constructor

Method Detail

getXAErrorString

public String getXAErrorString(XAException xaException)
Return the oracle error code as a string if the exception is _oracleXAExceptionClassName otherwise return null.

Parameters: xaException the XAException

Returns: an

getXid

public Xid getXid(XAResource xaResource, Xid xid)
Create the xid for use with the XA resource from the specified xid.

The default implementation is to return the xid.

Parameters: xaResource The XAResource xid The xid

Throws: XAException An error occured obtaining the xid

treatDifferentBranchesForSharedResourcesAsShared

public boolean treatDifferentBranchesForSharedResourcesAsShared()
Return true if shared xa resources can be treated as shared even if they use different branches so that these xa resources are not prepared/committed separately even if they don't have the same xid. This method is only used if OracleXAResourceHelper returns true. The default implementation returns false.

Returns: true if shared xa resources can be treated as shared even if they use different branches so that these xa resources are not prepared separately even if they don't have the same xid.

See Also: OracleXAResourceHelper

useDifferentBranchesForSharedResources

public boolean useDifferentBranchesForSharedResources()
Return true if shared xa resources must use different branches when enlisted in the transaction.The resource may still be treated as shared in that prepare/commit is only called once on a single xa resource (@see #treatDifferentBranchesForSharedResourcesAsShared}). The default implementation returns false.

Returns: true if shared xa resources must use different branches when enlisted in the transaction.

See Also: OracleXAResourceHelper

Original code is Copyright (c) 1999-2001, Intalio, Inc. All Rights Reserved. Contributions by MetaBoss team are Copyright (c) 2003-2005, Softaris Pty. Ltd. All Rights Reserved.