JTA or LOCAL transactions in JPA2+Hibernate 3.6.0?

Posted by Pangea on Stack Overflow See other posts from Stack Overflow or by Pangea
Published on 2010-12-30T03:19:24Z Indexed on 2010/12/30 3:54 UTC
Read the original article Hit count: 261

Filed under:
|
|
|
|

We are in the process of re-thinking our tech stack and below are our choices (We can't live without Spring and Hibernate due to the complexity etc of the app). We are also moving from J2EE 1.4 to JEE 5.

Tech stack

  1. JEE 5
  2. JPA 2.0 (I know JEE 5 only supports JPA 1.0 but we want to use Hibernate as the JPA provider)
  3. Hibernate 3.6.0 (We already have lots of hbm files with custom types etc. so we doesn't want to migrate them at this time to JPA. This means we want both jpa/hbm mappings work together and hence the Hibernate as the JPA provider instead of using the default that comes with App Server)

Now the problems is that I want to stick with local transactions but other team members want to use JTA. I have been working with J2EE for last 9 years and I've heard time and again people suggesting to stick with local transactions if I doesn't need two phase commits. This is not only for performance reasons but debugging/troubleshooting a local transaction is lot easier than a distributed transaction.

My suggestion is to use spring declarative transaction management + local transactions (HibernateTransactionManager)

I want to make sure if I am being paranoid or I have a valid point. I'd like to hear what the rest of the JEE world thinks.

Thank you.

© Stack Overflow or respective owner

Related posts about java

Related posts about jpa