javax.transaction.xa.XAResourcepublic class NetXAResource
extends java.lang.Object
implements javax.transaction.xa.XAResource
| Modifier and Type | Field | Description |
|---|---|---|
(package private) NetXACallInfo[] |
callInfoArray_ |
|
(package private) NetConnection |
conn_ |
|
(package private) SqlException |
exceptionsOnXA |
|
private static int |
INITIAL_CALLINFO_ELEMENTS |
|
private boolean |
keepIsolationLevel |
|
(package private) NetXAConnection |
netXAConn_ |
|
(package private) static ClientXid |
nullXid |
|
private int |
timeoutSeconds |
The value of the transaction timeout in seconds.
|
(package private) static int |
XAFUNC_COMMIT |
|
private static int |
XAFUNC_END |
|
private static int |
XAFUNC_FORGET |
|
private static int |
XAFUNC_PREPARE |
|
private static int |
XAFUNC_RECOVER |
|
(package private) static int |
XAFUNC_ROLLBACK |
|
private static int |
XAFUNC_START |
|
private static java.lang.String |
XAFUNCSTR_COMMIT |
|
private static java.lang.String |
XAFUNCSTR_END |
|
private static java.lang.String |
XAFUNCSTR_FORGET |
|
private static java.lang.String |
XAFUNCSTR_NONE |
|
private static java.lang.String |
XAFUNCSTR_PREPARE |
|
private static java.lang.String |
XAFUNCSTR_RECOVER |
|
private static java.lang.String |
XAFUNCSTR_ROLLBACK |
|
private static java.lang.String |
XAFUNCSTR_START |
| Constructor | Description |
|---|---|
NetXAResource(javax.sql.XAConnection xaconn,
NetXAConnection conn) |
| Modifier and Type | Method | Description |
|---|---|---|
void |
commit(javax.transaction.xa.Xid xid,
boolean onePhase) |
|
private void |
connectionClosedFailure() |
|
void |
end(javax.transaction.xa.Xid xid,
int flags) |
Ends the work performed on behalf of a transaction branch.
|
void |
forget(javax.transaction.xa.Xid xid) |
Tell the resource manager to forget about a heuristically (MANUALLY) completed transaction branch.
|
private int |
getSqlExceptionXAErrorCode(SqlException sqle) |
Get XAException.errorCode from SqlException
For disconnect exception, return XAER_RMFAIL
For other exceptions return XAER_RMERR
For server side SQLExceptions during
XA operations the errorCode has already been determined
and wrapped in an XAException for return to the client.
|
int |
getTransactionTimeout() |
Obtain the current transaction timeout value set for this XAResource
instance.
|
private java.lang.String |
getXAExceptionText(int rc) |
|
private java.lang.String |
getXAFuncStr(int xaFunc) |
|
boolean |
isSameRM(javax.transaction.xa.XAResource xares) |
|
boolean |
keepCurrentIsolationLevel() |
|
int |
prepare(javax.transaction.xa.Xid xid) |
Ask the resource manager to prepare for a transaction commit of the transaction specified in xid.
|
private java.lang.String |
processLocalHost(java.lang.String serverName) |
|
javax.transaction.xa.Xid[] |
recover(int flag) |
Obtain a list of prepared transaction branches from a resource manager.
|
void |
rollback(javax.transaction.xa.Xid xid) |
Inform the resource manager to roll back work done on behalf of a transaction branch
|
void |
setKeepCurrentIsolationLevel(boolean flag) |
|
boolean |
setTransactionTimeout(int seconds) |
Set the current transaction timeout value for this XAResource
instance.
|
private void |
setXaStateForXAException(int rc) |
Reset the transaction branch association state to XA_T0_NOT_ASSOCIATED
for XAER_RM* and XA_RB* Exceptions.
|
void |
start(javax.transaction.xa.Xid xid,
int flags) |
Start work on behalf of a transaction branch specified in xid
|
private void |
throwXAException(int rc) |
|
protected int |
xaRetValErrorAccumSQL(NetXACallInfo callInfo,
int currentRC) |
|
static boolean |
xidsEqual(javax.transaction.xa.Xid xid1,
javax.transaction.xa.Xid xid2) |
private static final int INITIAL_CALLINFO_ELEMENTS
static final ClientXid nullXid
static final int XAFUNC_COMMIT
private static final int XAFUNC_END
private static final int XAFUNC_FORGET
private static final int XAFUNC_PREPARE
private static final int XAFUNC_RECOVER
static final int XAFUNC_ROLLBACK
private static final int XAFUNC_START
private static final java.lang.String XAFUNCSTR_NONE
private static final java.lang.String XAFUNCSTR_COMMIT
private static final java.lang.String XAFUNCSTR_END
private static final java.lang.String XAFUNCSTR_FORGET
private static final java.lang.String XAFUNCSTR_PREPARE
private static final java.lang.String XAFUNCSTR_RECOVER
private static final java.lang.String XAFUNCSTR_ROLLBACK
private static final java.lang.String XAFUNCSTR_START
SqlException exceptionsOnXA
NetXAConnection netXAConn_
NetConnection conn_
private boolean keepIsolationLevel
NetXACallInfo[] callInfoArray_
private int timeoutSeconds
public NetXAResource(javax.sql.XAConnection xaconn,
NetXAConnection conn)
public void commit(javax.transaction.xa.Xid xid,
boolean onePhase)
throws javax.transaction.xa.XAException
commit in interface javax.transaction.xa.XAResourcejavax.transaction.xa.XAExceptionprivate int getSqlExceptionXAErrorCode(SqlException sqle)
sqle - SqlException to evaluate.public void end(javax.transaction.xa.Xid xid,
int flags)
throws javax.transaction.xa.XAException
end in interface javax.transaction.xa.XAResourcexid - A global transaction identifier that is the same as what was used previously in the start method.flags - One of TMSUCCESS, TMFAIL, or TMSUSPENDjavax.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 void forget(javax.transaction.xa.Xid xid)
throws javax.transaction.xa.XAException
forget in interface javax.transaction.xa.XAResourcexid - A global transaction identifierjavax.transaction.xa.XAException - An error has occurred. Possible exception values are XAER_RMERR, XAER_RMFAIL, XAER_NOTA,
XAER_INVAL, or XAER_PROTO.public int getTransactionTimeout()
throws javax.transaction.xa.XAException
getTransactionTimeout in interface javax.transaction.xa.XAResourcejavax.transaction.xa.XAExceptionpublic int prepare(javax.transaction.xa.Xid xid)
throws javax.transaction.xa.XAException
prepare in interface javax.transaction.xa.XAResourcexid - A global transaction identifierjavax.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 javax.transaction.xa.Xid[] recover(int flag)
throws javax.transaction.xa.XAException
recover in interface javax.transaction.xa.XAResourceflag - 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 void rollback(javax.transaction.xa.Xid xid)
throws javax.transaction.xa.XAException
rollback in interface javax.transaction.xa.XAResourcexid - A global transaction identifierjavax.transaction.xa.XAException - An error has occurredpublic boolean setTransactionTimeout(int seconds)
throws javax.transaction.xa.XAException
setTransactionTimeout in interface javax.transaction.xa.XAResourceseconds - the transaction timeout value in seconds.
Value of 0 means the reasource manager's default value.
Value of Integer.MAX_VALUE means no timeout.javax.transaction.xa.XAException - - An error has occurred. Possible exception
values are XAER_RMERR, XAER_RMFAIL, or XAER_INVAL.public void setKeepCurrentIsolationLevel(boolean flag)
public boolean keepCurrentIsolationLevel()
public void start(javax.transaction.xa.Xid xid,
int flags)
throws javax.transaction.xa.XAException
start in interface javax.transaction.xa.XAResourcexid - A global transaction identifier to be associated with the resourceflags - One of TMNOFLAGS, TMJOIN, or TMRESUMEjavax.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.private java.lang.String getXAExceptionText(int rc)
private void throwXAException(int rc)
throws javax.transaction.xa.XAException
javax.transaction.xa.XAExceptionprivate void setXaStateForXAException(int rc)
rc - // return code from XAExceptionjavax.transaction.xa.XAExceptionpublic boolean isSameRM(javax.transaction.xa.XAResource xares)
throws javax.transaction.xa.XAException
isSameRM in interface javax.transaction.xa.XAResourcejavax.transaction.xa.XAExceptionpublic static boolean xidsEqual(javax.transaction.xa.Xid xid1,
javax.transaction.xa.Xid xid2)
private void connectionClosedFailure()
throws javax.transaction.xa.XAException
javax.transaction.xa.XAExceptionprivate java.lang.String getXAFuncStr(int xaFunc)
protected int xaRetValErrorAccumSQL(NetXACallInfo callInfo, int currentRC)
private java.lang.String processLocalHost(java.lang.String serverName)
Apache Derby V10.14 Internals - Copyright © 2004,2018 The Apache Software Foundation. All Rights Reserved.