Session
Session (org.hibernate.Session)
A single-threaded, short-lived object representing a conversation between the application
and the persistent store.
Maintains a first level cache of data
Session is an interface and SessionImpl is the class which has implemented Session
interface, both are given in org.hibernate.*;
When ever session is opened then internally a database connection will be opened, in
order to get a session or open a session we need to call openSession() method
in SessionFactory, it means SessionFactory produces sessions.
Session sessionObj = sesssionFactoryObj .openSession();