jsp页面里的SessionFactory.closeSession();这句加在那里做什么?public void editNews(News news)throws HibernateException
{
session=SessionFactory.currentSession();
tx=session.beginTransaction();
session.update(news);
tx.commit();
SessionFactory.closeSession();
}
-------
这里的SessionFactory应该是静态类
关闭session应该直接写session.close()不过这个还是要看自己具体是怎么设计的,你的SessionFactory.closeSession()是针对哪个呢
{
session=SessionFactory.currentSession();
tx=session.beginTransaction();
session.update(news);
tx.commit();
SessionFactory.closeSession();
}
-------
这里的SessionFactory应该是静态类
关闭session应该直接写session.close()不过这个还是要看自己具体是怎么设计的,你的SessionFactory.closeSession()是针对哪个呢
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货