One tutorial I came across said "A SessionFactory is threadsafe, many threads can access it concurrently and request Sessions. A Session is a non-threadsafe object that represents a single unit-of-work with the database."
And it goes on to explain how to correct the problem using the ThreadLocal class.
The issue is I'm having is I'm not using
s = sessionFactory.openSession();
Instead, I'm using the openSession that takes a Connection.
s = sessionFactory.openSession(conn);
Since javax.sql.connection is open and closed after every
unit of work, I'm not sure how to make session threadsafe.
Any thoughts?