-->
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: method getCurrentSession() from SessionFactory class
PostPosted: Wed Sep 03, 2008 9:06 am 
Beginner
Beginner

Joined: Tue Aug 26, 2008 4:24 pm
Posts: 29
Hy, Iam a newbie with Hibernate. What is the method getCurrentSession() from SessionFactory class for?

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 03, 2008 2:43 pm 
Beginner
Beginner

Joined: Fri Aug 05, 2005 3:36 am
Posts: 28
You can use this method to access an object that implements Hibernate's Session interface, which is the primary interface through which applications can use Hibernate.

A session is a single-threaded context provided by Hibernate; your application will likely use it to issue queries; begin, commit, and roll back transactions; save and update objects; and the like.

getCurrentSession() retrieves whatever session is available to the current thread. If you are using the Spring integration with Hibernate, or if you have specified "current_session_context_class" as "thread" in your Hibernate configuration, you will probably use this method in your DAOs to access the Hibernate session.


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.