首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 其他教程 > 操作系统 >

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

2014-06-04 
在 ssh 下 解决 could not initialize proxy 和the owning Session was closed对于网上的种种 抄来抄去 转

在 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);

热点排行