`
poolok
  • 浏览: 3088 次
  • 性别: Icon_minigender_1
  • 来自: 广州
文章分类
社区版块
存档分类
最新评论

在 ssh 下 解决 could not initialize proxy 和the owning Session was closed

阅读更多
对于网上的种种 抄来抄去 转来转去 鸟解决办法 导致我发怒了 下面是我的解决办法 可以单元测试 不用改web.xml
在dao层 不管你 lazy false 还是 true 全部无敌解决

        r=(objec) ht.executeFind(new HibernateCallback(){

public List<Role> doInHibernate(Session s)throws HibernateException, SQLException {
List<objec> l=new ArrayList<objec>();
Transaction tran=s.beginTransaction();
Role q=(objec) s.load(objec.class,id);
q.getMenu().size();
l.add(q);
tran.commit();
s.close();
return l;
}
   
    }).get(0);
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics