what is the purpose and activity of SessionFactory in
hibernate?

Answer Posted / jadab

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 ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is j2ee api?

714


What is document root?

653


How do I become an expert in java?

673


What is button in java?

669


What is entity reference?

698


Is java important for my computer?

656


What are the main components of the j2ee application?

668


What is conversational state?

711


What is application client container?

698


What are the components and containers in java?

681


What spring is in related to j2ee?

722


What is attribute what is asant?

684


Why is java called technology?

647


Describe the ear, war, and jar.

684


What are the four components of j2ee application?

756