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
What is the latest technology used in java?
What are container services?
What is button in java?
What is authorization constraint?
What are struts?
Is object a composite data type in java?
What is a web container in j2ee?
Why is j2ee needed?
how to run servlet program between two computer through internet ?
What is java developer?
What is the mvc on struts?
What is attribute what is asant?
What is deployment descriptor?
What do you understand by j2ee?
What is application component provider?