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
Is eclipse written in java?
What is java listener?
What do you mean by j2ee module?
Where can I find java developers?
What is container-managed sign-on?
What is a java applet?
What is java api for xml processing (jaxp)?
What is a j2ee module?
Why java is not 100% object oriented language?
How does j2ee application work?
Why is java called object oriented?
What is the difference between load() and get()?
What is entity reference?
What is isv?
What is included in j2ee?