what is the purpose and activity of SessionFactory in
hibernate?

Answer Posted / pranay bhawsar

The SessionFactory is created from a Configuration object, and as its name implies it is a factory for Session
objects.
 
The SessionFactory is an expensive object to create. It, like the Configuration object, is usually created during
application start up. However, unlike the Configuration object, It should be created once and kept for later
use.

The SessionFactory object is used by all the threads of an application. It is a thread safe object. One
SessionFactory object is created per database. Multiple SessionFactory objects (each requiring a separate
Configuration) are created when connecting to multiple databases. The SessionFactory can also provide
caching of persistent objects.

The main use of session factory object is to get the session object for the application.

Is This Answer Correct ?    71 Yes 11 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

I’m new to WebLogic Does anyone knows how to Deploy Application using

1934


What is tomcat in j2ee?

645


What is the latest technology used in java?

710


What is jaxr client?

670


What is java gui?

673


What is component contract?

686


how to run servlet program between two computer through internet ?

2706


What is non primitive data type in java?

679


What is layout manager in java?

617


What is comment?

693


What is java 2 platform, standard edition (j2se)?

709


What do you mean by the component contract?

677


What are the different java technologies?

652


How do I become an expert in java?

671


What is a java application client?

717