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

Is object a composite data type in java?

490


What is cmp in j2ee?

489


Which software is used for java?

471


What is distributed application?

534


What is create method?

582






What is a web container j2ee?

492


What is build file?

523


What is context root?

562


Define the struts in the j2ee framework?

501


What is multi tier architecture in j2ee?

462


Who generates bytecode in java?

506


In DAO we are writting sql queries , how it is possible with creating and closing database connections.

1532


What is bean factory, have you used xmlbean factory?

502


How to create object without using the keyword “new” in java?

521


How many types of modules is defined by j2ee specification?

479