|
Oracle JDBC API Reference 11g Release 2 ("11.2.0.3.0") |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object oracle.jdbc.xa.OracleXAResource
public abstract class OracleXAResource
An Oracle XA Resource.
Field Summary | |
---|---|
static java.lang.String |
BUILD_DATE
|
static short |
DEFAULT_XA_TIMEOUT
|
static int |
ORAISOLATIONMASK
|
static int |
ORATMREADONLY
|
static int |
ORATMREADWRITE
|
static int |
ORATMSERIALIZABLE
|
static int |
ORATRANSLOOSE
|
static int |
TMENDRSCAN
|
static int |
TMFAIL
|
static int |
TMJOIN
|
static int |
TMMIGRATE
|
static int |
TMNOFLAGS
|
static int |
TMNOMIGRATE
|
static int |
TMONEPHASE
|
static int |
TMRESUME
|
static int |
TMSTARTRSCAN
|
static int |
TMSUCCESS
|
static int |
TMSUSPEND
|
static boolean |
TRACE
|
static int |
XA_OK
|
Fields inherited from interface javax.transaction.xa.XAResource |
---|
XA_RDONLY |
Constructor Summary | |
---|---|
OracleXAResource()
|
|
OracleXAResource(java.sql.Connection pm_conn,
OracleXAConnection xaconn)
OracleXAResource() -- The initializer. |
Method Summary | |
---|---|
abstract void |
commit(javax.transaction.xa.Xid xid,
boolean onePhase)
commit() -- Commit work done by global transaction specified by xid. |
abstract void |
end(javax.transaction.xa.Xid xid,
int flag)
end()-- End work performed on behalf of a transaction branch. |
abstract void |
forget(javax.transaction.xa.Xid xid)
forget() -- Tell RM to forget about a heuristically completed txn branch |
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)
prepare() -- Ask RM to prepare for a commit of the txn specified in 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)
rollback() -- Ask RM to roll back work done on behalf of a txn branch. |
boolean |
setTransactionTimeout(int seconds)
Set the current transaction timeout value for this XAResource instance. |
abstract void |
start(javax.transaction.xa.Xid xid,
int flag)
start() -- Starts work on behalf of a transaction branch. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int XA_OK
public static final short DEFAULT_XA_TIMEOUT
public static final int TMNOFLAGS
public static final int TMNOMIGRATE
public static final int TMENDRSCAN
public static final int TMFAIL
public static final int TMMIGRATE
public static final int TMJOIN
public static final int TMONEPHASE
public static final int TMRESUME
public static final int TMSTARTRSCAN
public static final int TMSUCCESS
public static final int TMSUSPEND
public static final int ORATMREADONLY
public static final int ORATMREADWRITE
public static final int ORATMSERIALIZABLE
public static final int ORAISOLATIONMASK
public static final int ORATRANSLOOSE
public static final java.lang.String BUILD_DATE
public static final boolean TRACE
Constructor Detail |
---|
public OracleXAResource()
public OracleXAResource(java.sql.Connection pm_conn, OracleXAConnection xaconn) throws javax.transaction.xa.XAException
javax.transaction.xa.XAException
- throws an exception if the connection object
is null.Method Detail |
---|
public abstract void start(javax.transaction.xa.Xid xid, int flag) throws javax.transaction.xa.XAException
start
in interface javax.transaction.xa.XAResource
xid
- A global transaction identifier.
javax.transaction.xa.XAException
- An error has occurred. Possible exceptions are XA_RB, XAER_RMERR,
XAER_RMFAIL, XAER_DUPID, XAER_OUTSIDE, XAER_NOTA, XAER_INVAL, or
XAER_PROTO.public abstract void end(javax.transaction.xa.Xid xid, int flag) throws javax.transaction.xa.XAException
end
in interface javax.transaction.xa.XAResource
xid
- A global transaction identifier that is the same
as what was used previously in the start method.flag
- One of TMSUCCESS, TMFAIL, or TMSUSPEND.
javax.transaction.xa.XAException
- An error has occurred. Possible XAException values are XAER_RMERR,
XAER_RMFAILED, XAER_NOTA, XAER_INVAL, XAER_PROTO, or XA_RB.public abstract void commit(javax.transaction.xa.Xid xid, boolean onePhase) throws javax.transaction.xa.XAException
commit
in interface javax.transaction.xa.XAResource
xid
- A global transaction identifier.onePhase
- If true, the RM should use a 1-phase commit protocol to
commit the work done on behalf of xid.
javax.transaction.xa.XAException
- (An error has occurred.)
Possible XAExceptions are XA_HEURHAZ, XA_HEURCOM,
XA_HEURRB, XA_HEURMIX, XAER_RMERR, XAER_RMFAIL, XAER_NOTA,
XAER_INVAL, or XAER_PROTO.
If the resource manager did not commit the txn and the paramether
onePhase is set to true, the RM may raise one of the XA_RB
exceptions. Upon return, the RM has rolled back the branch's
work and has released all held resources.public abstract int prepare(javax.transaction.xa.Xid xid) throws javax.transaction.xa.XAException
prepare
in interface javax.transaction.xa.XAResource
xid
- A global transaction identifier.
javax.transaction.xa.XAException
- (An error has occurred.)
Possible exception values are: XA_RB, XAER_RMERR, XAER_RMFAIL,
XAER_NOTA, XAER_INVAL, or XAER_PROTO.public abstract void forget(javax.transaction.xa.Xid xid) throws javax.transaction.xa.XAException
forget
in interface javax.transaction.xa.XAResource
xid
- A global transaction identifier.
javax.transaction.xa.XAException
- An error has occurred. Possible exception values are XAER_RMERR,
XAER_RMFAIL, XAER_NOTA, XAER_INVAL, or XAER_PROTO.public abstract void rollback(javax.transaction.xa.Xid xid) throws javax.transaction.xa.XAException
rollback
in interface javax.transaction.xa.XAResource
xid
- A global transaction identifier.
javax.transaction.xa.XAException
- An error has occurred.public javax.transaction.xa.Xid[] recover(int flag) throws javax.transaction.xa.XAException
MyXid[] xids = xaRes.recover(XAResource.TMSTARTRSCAN | XAResource.TMENDRSCAN); for (int i=0; xids != null && i < xids.length; i++) { try { xaRes.rollback(xids[i]); ...
MyXid[] xids = xaRes.recover(XAResource.TMSTARTRSCAN); while( xids!=null && xids.length>0) { for (int i=0; i < xids.length; i++) { try { xaRes.rollback(xids[i]); ... xids = xaRes.recover(XAResource.TMNOFLAG); } xaRes.recover(XAResource.TMENDRSCAN);
MyXid[] xids = xaRes.recover(XAResource.TMNOFLAG); for (int i=0; xids != null && i < xids.length; i++) { try { xaRes.rollback(xids[i]); ...
recover
in interface javax.transaction.xa.XAResource
flag
- One of TMSTARTRSCAN, TMENDRSCAN, TMNOFLAGS. TMNOFLAGS
must be used when no other flags are set in flags.
javax.transaction.xa.XAException
- An error has occurred. Possible values are
XAER_RMERR, XAER_RMFAIL, XAER_INVAL, and XAER_PROTO.public int getTransactionTimeout() throws javax.transaction.xa.XAException
getTransactionTimeout
in interface javax.transaction.xa.XAResource
javax.transaction.xa.XAException
- - An error has occurred. Possible exception
values are XAER_RMERR, XAER_RMFAIL.public boolean isSameRM(javax.transaction.xa.XAResource xares) throws javax.transaction.xa.XAException
isSameRM
in interface javax.transaction.xa.XAResource
xares
- - An XAResource object whose resource manager instance
is to be compared with the resource manager instance
of the target object.
javax.transaction.xa.XAException
- - An error has occurred. Possible exception
values are XAER_RMERR, XAER_RMFAIL.public boolean setTransactionTimeout(int seconds) throws javax.transaction.xa.XAException
setTransactionTimeout
in interface javax.transaction.xa.XAResource
seconds
- - transaction timeout value in seconds.
javax.transaction.xa.XAException
- - An error has occurred. Possible exception
values are XAER_RMERR, XAER_RMFAIL, or XAER_INVAL.
|
Oracle JDBC API Reference 11g Release 2 ("11.2.0.3.0") |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |