views:

57

answers:

0

Hi there,

I'm using Hibernate with a JTAFactory - in my case: jBossJTA - I've configured my hibernate.xml with the current JTA, now maybe I'm doing something wrong, my dao code looks like this

try{
  ses = sessionFactory.getCurrentSession();
  ses.beginTransaction();
  doSomeWork...
  session.getTransaction().commit();
}catch(Exception e){
 log.error(e.getMessage() + "Cause: " +e.getCause());
 session.getTransaction().rollback();
}
finally{
 if(session.isOpen())
  session.close();
}

Sometimes my jboss AS throws an expception and my webapp is dead

javax.servlet.ServletException: javax.transaction.SystemException: 
    java.lang.Throwable: Unabled to enlist resource, see the previous warnings. 
tx=TransactionImple < ac, BasicAction:a05dd21:43df:4b0d585b:37546 status: 
    ActionStatus.ABORT_ONLY >

Am I missing something or doing something wrong?