Oct 22nd, 2012, 12:22 AM
Access hibernate session in Tread
As Hibernate sessions are not thread-safe, I am not able to get currnet hibernate session through sessionFactory.getCurrentSession();
If I choose sessionFactory.openSession(); it works fine for thread itself but for nested classes it wont allow me to access same newly opened session.
I am using Spring 3.1.1 and Hibernate 4.1.3
Is there any way to get the current session in thread?
Or is there any way to access newly opened session to nested classes which are accessed from the thread?
Last edited by tejashpoojara; Oct 22nd, 2012 at 12:51 AM.