aspose file tools*
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 Soft Skills this week in the Jobs Discussion 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: 17260
    
    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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: CMT, Hibernate 3, JBoss and Transactions