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
How many types of constructors are there in java?
I’m new to WebLogic Does anyone knows how to Deploy Application using
Describe secure socket layer (ssl)?
What is java api for xml-based rpc (jax-rpc)?
What is setbounds in java?
What are the main components of a class in java?
What is a panel java?
Which edition of java is used for web application?
Why java is called robust and secure?
What are the java backend technologies?
What are the four components of j2ee application?
What are the technologies a java developer must know?
What is included in j2ee?
What is ejb jar file?
What is iso 3166?