my dog learned polymorphism*
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

CMT, Hibernate 3, JBoss and Transactions

Mark Spritzler

Joined: Feb 05, 2001
Posts: 17249

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.


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.
Don't get me started about those stupid light bulbs.
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