oracle.jdbc.xa
Class OracleXAResource

java.lang.Object
  |
  +--oracle.jdbc.xa.OracleXAResource

public abstract class OracleXAResource
extends java.lang.Object
implements javax.transaction.xa.XAResource


Field Summary
static short DEFAULT_XA_TIMEOUT
           
static int TMENDRSCAN
           
static int TMFAIL
           
static int TMJOIN
           
static int TMNOFLAGS
           
static int TMNOMIGRATE
           
static int TMONEPHASE
           
static int TMRESUME
           
static int TMSTARTRSCAN
           
static int TMSUCCESS
           
static int TMSUSPEND
           
static int XA_OK
           
 
Constructor Summary
OracleXAResource()
           
OracleXAResource(java.sql.Connection pm_conn)
           
 
Method Summary
abstract  void commit(javax.transaction.xa.Xid xid, boolean onePhase)
           
abstract  void end(javax.transaction.xa.Xid xid, int flag)
           
abstract  void forget(javax.transaction.xa.Xid xid)
           
 int getTransactionTimeout()
          Obtain the current transaction timeout value set for this XAResource instance.
 boolean isSameRM(javax.transaction.xa.XAResource xares)
          This method is called to determine if the resource manager instance represented by the target object is the same as the resouce manager instance represented by the parameter xares.
abstract  int prepare(javax.transaction.xa.Xid xid)
           
 javax.transaction.xa.Xid[] recover(int flag)
          Obtain a list of prepared transaction branches from a resource manager.
abstract  void rollback(javax.transaction.xa.Xid xid)
           
 boolean setTransactionTimeout(int seconds)
          Set the current transaction timeout value for this XAResource instance.
abstract  void start(javax.transaction.xa.Xid xid, int flag)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

XA_OK

public static final int XA_OK

DEFAULT_XA_TIMEOUT

public static final short DEFAULT_XA_TIMEOUT

TMNOFLAGS

public static final int TMNOFLAGS

TMNOMIGRATE

public static final int TMNOMIGRATE

TMENDRSCAN

public static final int TMENDRSCAN

TMFAIL

public static final int TMFAIL

TMJOIN

public static final int TMJOIN

TMONEPHASE

public static final int TMONEPHASE

TMRESUME

public static final int TMRESUME

TMSTARTRSCAN

public static final int TMSTARTRSCAN

TMSUCCESS

public static final int TMSUCCESS

TMSUSPEND

public static final int TMSUSPEND
Constructor Detail

OracleXAResource

public OracleXAResource()

OracleXAResource

public OracleXAResource(java.sql.Connection pm_conn)
                 throws javax.transaction.xa.XAException
Method Detail

start

public abstract void start(javax.transaction.xa.Xid xid,
                           int flag)
                    throws javax.transaction.xa.XAException
Specified by:
start in interface javax.transaction.xa.XAResource

end

public abstract void end(javax.transaction.xa.Xid xid,
                         int flag)
                  throws javax.transaction.xa.XAException
Specified by:
end in interface javax.transaction.xa.XAResource

commit

public abstract void commit(javax.transaction.xa.Xid xid,
                            boolean onePhase)
                     throws javax.transaction.xa.XAException
Specified by:
commit in interface javax.transaction.xa.XAResource

prepare

public abstract int prepare(javax.transaction.xa.Xid xid)
                     throws javax.transaction.xa.XAException
Specified by:
prepare in interface javax.transaction.xa.XAResource

forget

public abstract void forget(javax.transaction.xa.Xid xid)
                     throws javax.transaction.xa.XAException
Specified by:
forget in interface javax.transaction.xa.XAResource

rollback

public abstract void rollback(javax.transaction.xa.Xid xid)
                       throws javax.transaction.xa.XAException
Specified by:
rollback in interface javax.transaction.xa.XAResource

recover

public javax.transaction.xa.Xid[] recover(int flag)
                                   throws javax.transaction.xa.XAException
Obtain a list of prepared transaction branches from a resource manager. The transaction manager calls this method during recovery to obtain the list of transaction branches that are currently in prepared or heuristically completed states.
Specified by:
recover in interface javax.transaction.xa.XAResource
Parameters:
flag - One of TMSTARTRSCAN, TMENDRSCAN, TMNOFLAGS. TMNOFLAGS must be used when no other flags are set in flags.
Returns:
The resource manager returns zero or more XIDs for the transaction branches that are currently in a prepared or heuristically completed state. If an error occurs during the operation, the resource manager should raise the appropriate XAException.
Throws:
javax.transaction.xa.XAException - An error has occurred. Possible values are XAER_RMERR, XAER_RMFAIL, XAER_INVAL, and XAER_PROTO.

getTransactionTimeout

public int getTransactionTimeout()
                          throws javax.transaction.xa.XAException
Obtain the current transaction timeout value set for this XAResource instance. If XAResource.setTransactionTimeout was not use prior to invoking this method, the return value is the default timeout set fo the resource manager; otherwise, the value used in the previous setTransactionTimeout call is returned.

Specified by:
getTransactionTimeout in interface javax.transaction.xa.XAResource
Returns:
the transaction timeout value in seconds.
Throws:
javax.transaction.xa.XAException - - An error has occurred. Possible exception values are XAER_RMERR, XAER_RMFAIL.

isSameRM

public boolean isSameRM(javax.transaction.xa.XAResource xares)
                 throws javax.transaction.xa.XAException
This method is called to determine if the resource manager instance represented by the target object is the same as the resouce manager instance represented by the parameter xares.
Specified by:
isSameRM in interface javax.transaction.xa.XAResource
Parameters:
xares - - An XAResource object whose resource manager instance is to be compared with the resource manager instance of the target object.
Returns:
true if it's the same RM instance; otherwise false.
Throws:
javax.transaction.xa.XAException - - An error has occurred. Possible exception values are XAER_RMERR, XAER_RMFAIL.

setTransactionTimeout

public boolean setTransactionTimeout(int seconds)
                              throws javax.transaction.xa.XAException
Set the current transaction timeout value for this XAResource instance. Once set, this timeout value is effective until setTransactionTimeout is invoked again with a different value. To reset the timeout value to the default value used by the resource manager, set the value to zero. If the timeout operation is performed successfully, the method returns true; otherwise false. If a resource manager does not support transaction timeout value to be set explicitly, this method returns false.

Specified by:
setTransactionTimeout in interface javax.transaction.xa.XAResource
Parameters:
the - - transaction timeout value in seconds.
Throws:
javax.transaction.xa.XAException - - An error has occurred. Possible exception values are XAER_RMERR, XAER_RMFAIL, or XAER_INVAL.