-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Hibernate txns in J2EE managed environment?
PostPosted: Fri Oct 10, 2003 7:15 pm 
Beginner
Beginner

Joined: Wed Oct 08, 2003 4:22 pm
Posts: 29
We just started a comparison of Hibernate and OJB. OJB delivers a set of example EJBs in their download which show how to use container-managed transactions.

The Hibernate documentation seems to recommend letting Hibernate manage plain-vanilla txns, wrapped in stateless Session beans. In other words, to not use container managed txns.

How is this possible? When retrieving a Connection from a DataSource in a managed environment, it was my understanding you cannot call Commit. So is Hibernate somehow detecting the app server and letting the app server commit the txn??

Thanks,

Alex


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 10, 2003 9:00 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 3:00 pm
Posts: 1816
Location: Austin, TX
Quote:
it was my understanding you cannot call Commit

Absolutely incorrect. Now if the EJBs are utilizing CMT, then it is tru that you cannot explicitly commit the transaction. But outside of CMT, you can call commits against the UserTransaction of the TransactionManager managing the Datasource, which is what Hibernate does.

Quote:
The Hibernate documentation seems to recommend letting Hibernate manage plain-vanilla txns

Where is that? I use Hibernate behind a layer of CMT session EJBs and it works great (just simply do not call UserTransaction.commit()).


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.