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
|
|