-->
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 and session factory look up
PostPosted: Mon Dec 08, 2003 8:25 pm 
Beginner
Beginner

Joined: Fri Nov 28, 2003 3:45 am
Posts: 23
Location: malaysia
Dear All,


Supposing the transaction is to be managed by container (CMT), as advised by the hibernate team and this forum participant , there is no need to write any code to perform the client-demarcated JTA JNDI lookup such as


UserTransaction tx=(UserTransaction) ctx.lookup("UserTransaction");

I am a bit confused as to whether the session obtaind through SessionFactory JNDI look up is a must in order to perform query and normal business logic execution .Eventhough I do think if you need to execute hibernate related process , you must obtane a session to do the work. and I have success with CMT thorugh session lookup , without writting any single code for the transaction management for either EJB or Hibernate

Some one also suggest to me that [u]session is build up the trans[/u]action , [u]Transaction lifecycle exists much longer than session[/u]. Could any one qualify the statement please.


Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 08, 2003 8:31 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
There is no need to lookup the user transaction when using CMT. You will need to lookup the session factory to get the session to do your persistence operations. Session life cycle and transcation life cycle are not necessarily the same. It depends on the application and architecture. I will say that if you (initially) equate the two then you have less to be concerned about. The hibernate book will deal with this issue in detail no doubt.


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.