MessagingXAResource res = (MessagingXAResource)sess.getXAResource();
// prevent 1Pc optimisation
res.setPreventJoining(true);
XAResource res2 = new DummyXAResource(true);
XAResource res3 = new DummyXAResource();
XAResource res4 = new DummyXAResource();
Transaction tx = tm.getTransaction();
tx.enlistResource(res);
tx.enlistResource(res2);
tx.enlistResource(res3);