UserTransaction ut = UserTransactionFactory.userTransaction();
try
{
TransactionManager tm = TransactionManagerFactory.transactionManager();
DemoParticipant p = new DemoParticipant(ut.identifier());
DemoSynchronization s = new DemoSynchronization(ut.identifier());
ut.begin();
tm.enlist(p);