haveyou123456
will_pengwq
2011-10-12 22:44

session关闭问题

  • hibernate

public Fwxx select(Class c, int fwid){
Session session=HibernateSessionFactory.getSession();
Fwxx fwxx=(Fwxx)session.get(c,fwid);
System.out.println(fwxx.getLxr());
HibernateSessionFactory.closeSession();
return fwxx;

}

查询完之后就关闭session,但是当在action调用这个方法的时候就报
could not initialize proxy - the owning Session was closed

  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

4条回答

为你推荐

换一换