title: session.clear() is necessary?
body: <p>I am using Hibernate for my all database related task .
  I am using a HIbernateUTIl class to maintain the connections and doing  something like this </p>
  
  <pre><code>Session session = null;
  SessionFactory sessionfactory = HibernateUtil.getSessionFactory();
  session = sessionfactory.openSession();
  </code></pre>
  
  <p>at the end of the code in the finally block i do </p>
  
  <pre><code>session.close();
  </code></pre>
  
  <p>and after that my function gets over , inside the function i am firing some queries and getting the result in arraylist.</p>
  
  <p>my question is that : is the primary level cache is cleared as soon as i am closing the session or i have to forcibly clear that with </p>
  
  <pre><code>session.clear()
  </code></pre>
  
  <p>and if the primary cache is not cleared will it hold the refernces to my object , which will make them unreachable for garbage collection and ultimately a memory loss .. please help</p>