title: Close Opened Hibernation sessions if exist
body: <p>When a Hibernate session is opened (<code>sessionFactory.openSession()</code>) it might be closed. It is ok. In case it is missed to close an opened session which is used to retrieve data (not to save or update or delete) any where in the application, how to close opened sessions if exists?</p>
  
  <p>(Let's say when a <code>JFrame</code> is closed, if there are opened sessions available, they must be closed. Closing sessions can be done by going through the codes one by one, but I mean here, without checking codes, is there any way to close sessions which are missed to close with some piece of code).</p>