try
{
UserTransaction ut = UserTransaction.getUserTransaction();
TransactionManager tm = TransactionManager.getTransactionManager();
FailureParticipant p1 = new FailureParticipant(FailureParticipant.FAIL_IN_ROLLBACK, FailureParticipant.WRONG_STATE);
DemoDurableParticipant p2 = new DemoDurableParticipant();
ut.begin();
tm.enlistForDurableTwoPhase(p1, null);