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: CMT, Hibernate in JBoss
PostPosted: Sun Mar 05, 2006 6:25 am 
Beginner
Beginner

Joined: Thu Sep 30, 2004 4:17 am
Posts: 21
I am using Hibernate 3.1 in JBoss 3.2.7. I want to use CMT in my Stateless Session Beans. I couldn't find an example anywhere on how to do this. All examples I see from Hibernate is all doing the following inside the EJB method:
o Get Session
o Begin transaction
o Save/Update
o Commit

Instead, I want to do:
o Get Session
o Save/Update
The session close, commit/rollback should be automatically taken care by the Container in JBoss. How do I do this?


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 05, 2006 6:57 am 
Regular
Regular

Joined: Wed Feb 08, 2006 3:59 pm
Posts: 75
Yes you can skip the start transaction and the commit/rollback steps. You just have to mark the bean method as transactionnal. If you use XDoclet add this tag :

Code:
@ejb.transaction type = "Required"


Replace "Required" by the type you need.


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.