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 mean by connection pooling?

538


What are types of j2ee clients?

500


What is application component provider?

543


How do I become an expert in java?

472


What is source file in java?

506






What is jlayeredpane java?

460


What is java ee server?

457


Which java technology is in demand?

471


What is the best java compiler?

466


What is javaserver pages (jsp)?

502


What is javafx java?

515


What is urn?

520


What is main method in java?

494


What is j2ee component?

501


What are the components and containers in java?

490