what is the purpose and activity of SessionFactory in
hibernate?

Answer Posted / ankur

Configuration object is used to create a SessionFactory object which inturn configures Hibernate for the application using the supplied configuration file and allows for a Session object to be instantiated. The SessionFactory is a thread safe object and used by all the threads of an application.

The SessionFactory is is heavyweight object so usually it is created during application start up and kept for later use. You would need one SessionFactory object per database using a separate configuration file. So if you are using multiple databases then you would have to create multiple SessionFactory objects.

Is This Answer Correct ?    2 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is ear file?

549


What is caller principal?

563


How will you explain load() and get() methods?

522


What is japplet in java?

519


Which software is used for java?

481






What is the latest technology used in java?

519


How does event listener work in java?

478


How can I be good in java?

529


What is multi tier architecture in j2ee?

468


What is full form of j2ee?

532


Why primitive data types in java are not objects?

473


Is java is fully object oriented?

522


Which of the following are subclasses of java awt component?

499


What is the mvc on struts?

520


What is jaxr client?

530