-->
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: Advantage of using ThreadLocal for storing sessions!
PostPosted: Wed Aug 23, 2006 11:49 am 
Beginner
Beginner

Joined: Tue Aug 08, 2006 11:53 am
Posts: 37
Hi all,

I am not able to understand why do we need to store session in the threadlocal variable. Is it really necessay to use HibernateUtil rather than using the following code

public final class DAOFactory
{
public static SessionFactory csaSessionFactory=null;

public static SessionFactory getCsaSessionFactory() {

if(csaSessionFactory!=null) {
return csaSessionFactory;
}

Configuration c=new Configuration();
c.configure();
csaSessionFactory = c.buildSessionFactory();
return csaSessionFactory;
}

Thank you for your help!

Hibernate version: 3.x


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 23, 2006 12:36 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
http://hibernate.org/42.html


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.