Is it thread safe to obtain a Hibernate session via SessionFactory.getCurrentSession()?
Suppose I have one static SessionFactory object which is used for my entire app, and I have 5 concurrent requests being made to my servlet. My servlet calls the method Auth.checkLogin() for each of those requests, and Auth.checkLogin() in turn obtains a session via the static factory.getCurrentSession().
At the end of each of the requests to my servlet, transaction.commit() is called on the session which was previously obtained.
My question is, is this a thread safe method? Or should I make any changes?