top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

What is Hibernate SessionFactory and how to configure it?

0 votes
261 views
What is Hibernate SessionFactory and how to configure it?
posted Sep 7, 2017 by anonymous

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

SessionFactory is the factory class used to get the Session objects. SessionFactory is responsible to read the hibernate configuration parameters and connect to the database and provide Session objects. 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.

SessionFactory also provide methods to get the Class metadata and Statistics instance to get the stats of query executions, second level cache details etc.

answer Sep 11, 2017 by Rajesh Jk
...