Joined: Fri Dec 17, 2004 12:54 pm Posts: 13
|
Hi,
I'm using Hibernate in a web application framework and have a thread local object that has a method used by a lot of different classes during the request cycle to get a hibernate session.
In regards to this I'm stuck on something very simple. When a class requests a session does the thread local object call sessionfactory.createSession() for each getSession() request or does it create the session just once at the begining of the page request cycle and return a reference to that single session object in the getSession() method?
If a session should be created for each call to getSession() then what is the point of using a thread local object?
Thanks for any input.
|
|