Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HibernateUtil.getSessionFactory().close() method in hibernate

 
Mathew Lee
Ranch Hand
Posts: 238
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I wou.d like to know what is HibernateUtil.getSessionFactory().close() method in hibernate. Where and how and why to use it. How is it different from session.close used in CRUD operations. Any ideas, resources, links, sample code highly appreciated. thanks in advance.
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The docs say:

Destroy this SessionFactory and release all resources (caches, connection pools, etc).

So that is what is does. Its unlikely you are ever going to need to call this given the life time of your SessionFactory is also likely to be that of your applicaiton.


How is it different from session.close used in CRUD operations

Session.close() closes the session.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic