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