try
{
UserTransaction ut = UserTransaction.getUserTransaction();
TransactionManager tm = TransactionManager.getTransactionManager();
DemoDurableParticipant p = new DemoDurableParticipant();
DemoVolatileParticipant pz = new DemoVolatileParticipant();
ut.begin();
tm.enlistForDurableTwoPhase(p, null);
tm.enlistForVolatileTwoPhase(pz, null);