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

Why is java robust?

657


Is string a primitive data type in java?

484


What is declarative security ?

572


What are the components of J2EE application?

527


what is interface in java ?can you explain with simple example?and what is the difference between abstract and interface?

2061






Explain the j2ee tiers.

480


What is assembly in java?

480


What do you understand by connector?

514


Why java is called robust and secure?

480


Where is java used?

492


Is java is fully object oriented?

514


Is java a high level language?

496


What are the modules of j2ee?

510


What is authorization?

590


Are java primitives objects?

469