Hibernate - Role of SessionFactory interface plays

State the role of SessionFactory interface plays in Hibernate.

- The SessionFactory is used to create Sessions. Each application is having usually only one SessionFactory. The requests from the servicing client threads obtain the Sessions from the session factory. SessionFactory is thread safe, so that many threads can access it concurrently and requests the sessions.

State the role of SessionFactory interface plays in Hibernate.

- An application obtains Session instances from a SessionFactory which is typically single for the whole application created during its initialization.

- The SessionFactory caches generate SQL statements and other mapping metadata that Hibernate uses at runtime.

- It also holds cached data that has been read in one unit of work and may be reused in a future unit of work.
SessionFactory sessionFactory = configuration.buildSessionFactory();
Hibernate - Difference between load() and get() in Hibernate.
Difference between load() and get() in Hibernate - The load() method throws an exception,when the unique id could not found in the database...
Hibernate - What is the difference between merge and update?
What is the difference between merge and update? - update () : When the session does not contain an persistent instance with the same identifier...
Hibernate - What is the advantage of Hibernate over jdbc?
What is the advantage of Hibernate over jdbc? - Hibernate code will work well for all databases, for ex: Oracle,MySQL, etc. where as JDBC is database specific...
Post your comment