Results 1 to 1 of 1

Thread: Access hibernate session in Tread

  1. #1

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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •