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 the difference between java and core java?

482


What is considered as a web component?

557


What is build tool in java?

491


Is java important for my computer?

478


What is java mobile?

486






What is frame in java?

501


Is java more difficult than c++?

472


Explain the j2ee tiers.

476


What is difference between j2ee and java?

492


What does java ee stand for?

445


What is javaserver pages (jsp)?

504


Who generates bytecode in java?

506


What is javamail?

529


What is j2ee component?

505


What is empty tag?

513