1.

What is a SessionFactory?

Answer»

SessionFactory provides an instance of Session. It is a factory class that gives the Session objects based on the CONFIGURATION PARAMETERS in order to establish the connection to the database.
As a good practice, the application generally has a single instance of SessionFactory. The internal STATE of a SessionFactory which includes metadata about ORM is immutable, i.e once the instance is created, it cannot be changed.

This also provides the facility to get information LIKE statistics and metadata related to a class, query executions, etc. It also holds second-level cache data if ENABLED.



Discussion

No Comment Found