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 are the modules of j2ee?
What is context attribute?
What is the difference between load() and get()?
What is j2ee product provider?
Since we can create managed bean by two ways as, we can define the bean name in faces-config.xml file so that page can use that OR we can write annotation on bean class so that it is automatically assign to page but I want to know which one is good programming practice ? And also mention disadvantage of other which should not prefer ... Thanking you...
What is ebxml?
What is cmp in j2ee?
What is jaap?
What is j2ee module?
What is interpreter in java?
What is java api for xml registries (jaxr)?
Which package is imported by default in java?
What is create method?
What are the advanced technologies in java?
Explain the four types of container that the j2ee specification defines