what is the purpose and activity of SessionFactory in
hibernate?
Answer Posted / pranay bhawsar
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 ? | 71 Yes | 11 No |
Post New Answer View All Answers
Is java important for my computer?
Is java more difficult than c++?
What are the tools in java?
Is j2ee a language or framework?
What is the container?
What is full form of j2ee?
What is attribute what is asant?
What is jaap?
What is api in j2ee?
What is content?
What is bean factory, have you used xmlbean factory?
What is deployer?
What are the components of j2ee applications?
What is mean by j2ee?
How do I become a java developer?