close « DAO « JPA Q&A





1. problem in hibernate DAO (session already closed!!)    stackoverflow.com

I have implemented DAO as follows, //pseudoCode

public MyDAO{

  private Session session;
  MYDAO{
  this.setSession(HibernateUtil.getSessionFactory().getCurrentSession());
  }

  public void save(MyObj obj){
   //save obj in db
  }
}
Now ...