This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes CMT, Hibernate 3, JBoss and Transactions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "CMT, Hibernate 3, JBoss and Transactions" Watch "CMT, Hibernate 3, JBoss and Transactions" New topic
Author

CMT, Hibernate 3, JBoss and Transactions

Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

In "Hibernate in Action", in the transaction section it states that session.beginTransaction() will join the JTA transaction, and tx.commit() is called to communicate witht he databse.

Is this a must, if you have your method demarcated using EJB 3.0 transaction. declaring it as "RequiresNew" as the annotation on the method?

Another person here at work stated that in another company he worked using EJB 2.1 they did not need to have a call to session.beginTransaction() or tx.commit(), that because you have a CMT transaction, it handles it all. He was also using Weblogic and not JBoss in that other company.

Thanks for your help.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Jignesh Patel
Ranch Hand

Joined: Nov 03, 2001
Posts: 626

Yup hibernateSession.beginTransaction() joins JTA.
When I used with weblogic, since I don't need JTA, I ended up by saying not supported for all SLSB methods.

Howwever I have not tested what impact it will make when I will not use begintransaction and commit.

I can update you in couple of days.
Jignesh Patel
Ranch Hand

Joined: Nov 03, 2001
Posts: 626

I forget to mention I am using Hibernate2.0.
 
wood burning stoves
 
subject: CMT, Hibernate 3, JBoss and Transactions
 
Similar Threads
UserTransaction in Hibernate
Hibernate Session.beginTransaction with JBoss
With respect to using CMT Transactions in SessionBeans and Hibernate
hibernate Transaction with Jboss(CMT)
Exception handling in EJB with Container Managed Transaction using Hibernate