ConnectionJDBC2 con = (ConnectionJDBC2)connection;
if (con.isXaEmulation()) {
//
// Emulate xa_end method
//
JtdsXid lxid = new JtdsXid(xid);
if (con.getXaState() != XA_START) {
// Connection not started
raiseXAException(XAException.XAER_PROTO);
}
JtdsXid tran = (JtdsXid)con.getXid();
if (tran == null || !tran.equals(lxid)) {
raiseXAException(XAException.XAER_NOTA);
}
if (flags != XAResource.TMSUCCESS &&
flags != XAResource.TMFAIL) {
// TMSUSPEND and TMMIGRATE cannot be supported