title: designing a hibernate dao
body: <p>I am using following code</p>
  
  <pre><code> TestDAO {
  
      Session session = null;
  
      public TestDAO() {
          this.session = HibernateUtil.getSessionFactory().getCurrentSession();
      }
  
     //...more code create,update ...
    //each method starts a transcation using  "tx= session.beginTransaction();"
  </code></pre>
  
  <p>}</p>
  
  <p>1)Now should i commit the transcation using tx.commit for a fetch operation too or only for save/update operation?? <br>
  2)Should i create a seperate instance of TestDAO every time i need?Or should i create a singleton class that returns a single instance of DAO everytme?Will this have a problem?</p>