Unfortunately we get another error if we use CMTTransactionFactory instead. Hibernate says that "getNamedQuery is not valid without active transaction". The method getNamedQuery is invoked from an EJB with container managed transactions.
[2010-04-26 12:47:10:554 CEST] 0000000e LocalExceptio E CNTR0020E: EJB threw an unexpected (non-declared) exception during invocation of method "doCrashRecovery" on bean "BeanId(.........................., null)". Exception data: org.hibernate.HibernateException: getNamedQuery is not valid without active transaction
at org.hibernate.context.ThreadLocalSessionContext$TransactionProtectionWrapper.invoke(ThreadLocalSessionContext.java:340)
at $Proxy27.getNamedQuery(Unknown Source)
....................
But as we understood it, "org.hibernate.transaction.JTATransactionFactory" should work for both container managed and bean managed transactions:
http://docs.jboss.org/hibernate/stable/ ... onstrategy