Atomikos Forum |
|
Hi,
I followed the Tomcat7 integration tutorial for setting up container managed transactions (CMT). It works out of the box with Spring4/JPA/Hibernate. But when I try to setup CMT with Hibernate4 without Spring and JPA, I don't get it working. My setup is the following: - Simple Web app - Servlet 3.1 API - Hibernate 4.3.9 - Tomcat 7 setup as explained in the atomikos integration tutorial - Oracle XA Datasource hibernate.cfg.xml contains JTA configuration: - <property name="hibernate.transaction.jta.platform">at.gv.brz.justiz3.test.atomikos.AtomikosJtaPlatform</property> - The AtomikosJtaPlatform extends the org.hibernate.engine.transaction.jta.platform.internal.AbstractJtaPlatform and returns the TransactionManager as well as the UserTransaction via JNDI successfully - <property name="hibernate.current_session_context_class">jta</property> - The datasource is retrieved via JNDI lookup Having setup all this stuff, when I try to get a hibernate session via org.hibernate.internal.SessionFactoryImpl.getCurrentSession, I get an exception at org.hibernate.context.internal.JTASessionContext.currentSession that it is unable to locate current JTA transaction. So, what I', doing wrong? Thanks, Torsten |