到 Google 资讯主页   
EasyJF首页   资料   源码   软件    论坛   网站    
   使用帮助    
    该信息为本站MyRSS系统缓存内容,部分图片及附件有可能无法正常使用.easyjf.comgeneral.blogjava.net无关,不对该信息负责.通过http://www.blogjava.net/burt/archive/2007/10/14/152760.html访问该信息的原始内容.
页面功能  【加入收藏】 【推荐给朋友】 【字体:  】 【关闭】   
无法读取外键表
作者:神的小火柴 来源:general.blogjava.net  发布时间:2007-10-14 19:23:26.923

严重: Servlet.service() for servlet jsp threw exception
org.hibernate.LazyInitializationException: could not initialize proxy - no Session

用hibernate的daosupporr继承类读取所有内容表,放到request中,jsp页面显示。
如果读取内容表外键关联的类别表的内容就出错。

hibernate3 many-to-one的默认选项为lazy="proxy"

把many-to-one或one-to-many的属性lazy改为lazy="false"




神的小火柴 2007-10-14 17:19 发表评论

 
相关文章
 
页面功能  【加入收藏】 【推荐给朋友】 【字体:  】 【关闭】   


EasyJF.com 2006 隐私政策 使用EasyJF前必读