Is SessionFactory.getCurrentSession() thread safe? Is SessionFactory.getCurrentSession() thread safe? multithreading multithreading

Is SessionFactory.getCurrentSession() thread safe?


From Hibernate 4.0 SessionFactory

The main contract here is the creation of Session instances. Usually an application has a single SessionFactory instance and threads servicing client requests obtain Session instances from this factory.

The internal state of a SessionFactory is immutable. Once it is created this internal state is set. This internal state includes all of the metadata about Object/Relational Mapping.

Implementors must be threadsafe.

So then

Is it thread safe to obtain a Hibernate session via SessionFactory.getCurrentSession()?

For what api says then Yes.