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
What is a j2ee container?
What is java secure socket extension (jsse)?
Is a relationship java?
What is callback methods Component methods called by the container to notify the component of important events in its life cycle?
What is architecture neutral in java?
What is j2ee tutorial?
What are the advantages of object-relational mapping (orm)?
What is form-based authentication?
What is advance java?
Is java a web technology?
to update a batch in a table in jdbc which method of statement object is used
Differentiate between .ear, .jar and .war files.
What is the preferred size of a component in java?
What is single tier architecture in java?
Define hashtable in j2ee?