destroySession();
try
{
// Get a reference to the UT session factory.
UserTransactionSessionFactory factory;
Hashtable env = (Hashtable) NamingContextFactory.lastInitialContextEnv.get();
InitialContext ctx = new InitialContext(env);
factory = (UserTransactionSessionFactory) ctx.lookup("UserTransactionSessionFactory");
// Call factory to get a UT session.
session = factory.newInstance();
}
catch (Exception ex)
{
throw new RuntimeException("UT factory lookup failed", ex);
}