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
What do you mean by the component contract?
What is application assembler?
What is j2ee technology?
Is a relationship java?
How java is reliable?
What is tomcat in j2ee?
What are the components of J2EE application?
How long does it take to master java?
What is isv?
What are the component of java?
What are struts?
Is java safe to download?
What is actionerrors?
What should a junior java developer know?
What is 2 stands for in j2ee?