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 j2ee a language or framework?
Is java safe to download?
What is javabeans component?
What is context attribute?
What is awt package in java?
What do you understand by connector? Explain connector architecture.
What is the name of java compiler?
Is core java and j2se same?
What is java 2 platform, standard edition (j2se)?
Who is java developer?
Hi Friends. I want complete technical flow of j2ee project with following technologies. jsp , servlet , Struts , Hibernate , (should follow mvc-2 design pattern) . with DAO ,DTO SERVICE layers .
What are the advantages in the use of spring for application development?
Is java a high level language?
Explain the four types of container that the j2ee specification defines
Which of the following are subclasses of java awt component?