aspose file tools*
The moose likes Other Application Frameworks and the fly likes transaction management in spring Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Frameworks » Other Application Frameworks
Bookmark "transaction management in spring" Watch "transaction management in spring" New topic
Author

transaction management in spring

Abhinav Srivastava
Ranch Hand

Joined: Nov 19, 2002
Posts: 349

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?
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

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.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: transaction management in spring
 
Similar Threads
hibernate in Spring framework
tutorial on setting up transactionmanager on tomcat 6
Hibernate and transaction management
hibernate with Container Managed Transactions (CMT)
Spring Interview Questions