//start a global transaction and default holdability and autocommit will be switched to match Derby XA restrictions
xr.start(xid, XAResource.TMNOFLAGS);
System.out.println("Notice that autocommit now is " + conn1.getAutoCommit() + " for connection because it is part of the global transaction");
System.out.println("Notice that connection's holdability at this point is CLOSE_CURSORS_AT_COMMIT because it is part of the global transaction");
System.out.println("CONNECTION(in xa transaction) HOLDABILITY " + (conn1.getHoldability() == ResultSet.HOLD_CURSORS_OVER_COMMIT));
xr.end(xid, XAResource.TMSUCCESS);
conn1.commit();
conn1.close();
xid = getXid(27, (byte) 21, (byte) 01);
xr.start(xid, XAResource.TMNOFLAGS);