• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
  • Piet Souris
  • Frits Walraven
  • Carey Brown

transaction management in spring

Ranch Hand
Posts: 354
Eclipse IDE Oracle Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Say I am using Spring in a JEE container with JPA/Hibernate.
Should Spring use the JpaTransactionManager or HibernateTransactionManager or JtaTransactionManager or if any transaction manager is required at all if EJB transaction management is used?
Posts: 17346
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, it is up to you. You can choose whatever transaction manager you want. Are you using any Hibernate specific stuff, or is all your code JPA. If you are straight JPA, then if you choice was down to HibernateTransactionManager or JPATransactionManager, well you still have a choice of either one. But if you have some Hibernate specific stuff, and you had just those two choices, you would have to choose HibernateTransactionManager because you have some Hibernate specific stuff.

But with all three, you can always just use JTATransactionManager if you wanted and not worry whether there is Hibernate specific stuff or not. But know that if you take your stuff out of the JEE container and not have a JTATransactionManager then you are stuck. So if you ever think you will run the code outside a JEE container, then choose Hibernate or JPA Transaction Managers.

Hope that helps.

Forget this weirdo. You guys wanna see something really neat? I just have to take off my shoe .... (hint: it's a tiny ad)
Thread Boost feature
    Bookmark Topic Watch Topic
  • New Topic