It is not intended that implementors be threadsafe. Instead each thread/transaction should obtain its own instance from a SessionFactory.
Obtains the current session. The definition of what exactly "current" means controlled by the CurrentSessionContext impl configured for use.
So if session object is not threadsafe, what happens when two threads call sessionFactory.getCurrentSession() .... if they get the same session object will there not be chances of all the dangers that threads cause when they get the same instance?
java api of CurrentSessionContext did not help and when i browsed through the code for implementors of CurrentSessionContext, it seemed to me that it is returning the same session object.
Please help, this has been bugging me for some time now.
posted 4 years ago
Really looking forward to any help with the above question
Good night. Drive safely. Here's a tiny ad for the road: