XAResource xares = r1.getXAResource();
xares.start(xid1);
..
xares.end(xid1);
..
xares.start(xid2);
..
status = xares.prepare(xid1);
..
xares.commit(xid1, false);
A transactional resource r1. Global transaction xid1 is started and ended with r1. Then a different global transaction xid2 is associated with r1. Meanwhile, the transaction manager may start the two phase commit process for xid1 using r1 or any other transactional resource connected to the same resource manager. The resource adapter needs to allow the commit process to be executed while the resource is currently associated with a different global transaction.