What is the role of Session interface in Hibernate?

Answer

The session interface is the primary interface used in Hibernate Application. It is single threaded sort-lived object and represents conversation between Application and the persistent store. It helps to create query objects to retrieve persistent objects.

You can get the session object from session factory

Session session = sessionFactory.openSession();

Session Interface role:

--Wraps a JDBC connection
--Factory for Transaction
--Holds a mandatory (first-level) cache of persistent objects, used when navigating the object graph or looking up objects by identifier

All hibernate Questions

Ask your interview questions on hibernate

Write Your comment or Questions if you want the answers on hibernate from hibernate Experts
Name* :
Email Id* :
Mob no* :
Question
Or
Comment* :
 





Disclimer: PCDS.CO.IN not responsible for any content, information, data or any feature of website. If you are using this website then its your own responsibility to understand the content of the website

--------- Tutorials ---