// Rollback the global transaction
try {
conn.xa_rollback();
} catch (SQLException sqle) {
XAException ex = new XAException(XAException.XAER_RMERR);
ex.initCause(sqle);
throw ex;
}
// Do the cleanup on the resource
creatingResource.returnConnectionToResource(this, xid);