Atomikos Forum

JPA/Hibernate with Spring example

I am evaluating transaction essentials for the second time and I still can't find a working example with JPA.

I've seen many tutorials and even a completely working example on the Spring forum with JDBC/JMS and Hibernate/JMS but I've found nothing regarding JPA.

I am using 3.6.0 with hibernate 3.3.2 and Spring 2.5.6. I was able to create a working example by commenting out the <prop key="hibernate.transaction.factory_class">com.atomikos.icatch.jta.hibernate3.AtomikosJTATransactionFactory</prop>

The problem is that flush does not work as suggested by

2010-02-09 16:38:26 SessionFactoryImpl [WARN] JTASessionContext being used with JDBCTransactionFactory; auto-flush will not operate correctly with getCurrentSession()

I've seen workarounds to use JoinableCMTTransactionFactory instead but it won't fit a unit test or simple tomcat scenario.

I am bit puzzled. Is there a working example with JPA/Hibernate + JMS that works truely outside the container?
Stephane Nicoll Send private email
Tuesday, February 09, 2010
 
 
Hi,

The problem is with Hibernate 3.3.2 which breaks prior interfaces - it works with Hibernate 3.2.3.GA until we have solved this thing.

HTH
Guy Pardon Send private email
Tuesday, February 09, 2010
 
 
3.2.3 specifically? Do you have a reference to a bug request for that issue?

3.2.3 is not an option to us unfortunately.
Stephane Nicoll Send private email
Wednesday, February 10, 2010
 
 
okay, let me try to summarize the situation here.

According to this issue, we should use 3.2.3 or prior. According to another issue (http://opensource.atlassian.com/projects/hibernate/browse/HHH-3358) that is fixed AFTER 3.2.3, I can't start atomikos with hibernate since it's looking up something in JNDI.

There are examples of valid usage with Hibernate only + JMS or plain JDBC and Hibernate 3.2.3.

Is there a way to make it work with JPA/Hibernate 3.3 and JMS without a JNDI access?
Stephane Nicoll Send private email
Wednesday, February 10, 2010
 
 
Hi,

There is a Hibernate issue that supposedly fixes this in later releases of Hibernate:

http://opensource.atlassian.com/projects/hibernate/browse/HHH-3358

I haven't seen this in their released code yet, though. Should you find it, please let me know.

Best
Guy Pardon Send private email
Wednesday, February 10, 2010
 
 
I know that. It's in my reply ...
Stephane Nicoll Send private email
Wednesday, February 10, 2010
 
 
so no support for JPA/Hibernate? Is it true or am I missing something?
Stephane Nicoll Send private email
Wednesday, February 10, 2010
 
 
Again, you can use Hibernate 3.2.3 - AFAIK that one did not have the weird JNDI issue.

For later releases of Hibernate, you can use a standalone/embedded JNDI provider or ask the people at Hibernate to include the fix in their releases.

Best
Guy Pardon Send private email
Monday, February 15, 2010
 
 

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics