-->
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.  [ 3 posts ] 
Author Message
 Post subject: diff between openSession and getCurrentSession
PostPosted: Tue Feb 05, 2008 8:33 am 
Newbie

Joined: Tue Feb 05, 2008 8:02 am
Posts: 2
Can anybody explain the difference between openSession and getCurrentSession .And which is suitable for webapplication


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 05, 2008 8:37 am 
Beginner
Beginner

Joined: Mon Nov 19, 2007 4:40 pm
Posts: 46
I am assuming you are referring to the session factory implementation...

getCurrentSession gets the current session bound to your thread (if you have a thread-bound implementation) and openSession opens a new session. My getCurrentSession creates a new session by calling openSession if one is not already bound to the thread.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 07, 2008 8:49 am 
Beginner
Beginner

Joined: Mon Nov 19, 2007 4:40 pm
Posts: 46
If my response has been helpful, please rate...


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.