posts - 431,  comments - 344,  trackbacks - 0
异常:
org.hibernate.LazyInitializationException: could not initialize proxy - no Session
at org.hibernate.proxy.AbstractLazyInitializer.initialize(AbstractLazyInitializer.java:57)
at org.hibernate.proxy.AbstractLazyInitializer.getImplementation(AbstractLazyInitializer.java:111
)

原因:hibernate3 many-to-one的默认选项是 lazy = "proxy"
解决方法:<many-to-one>  & <set> 中设置 lazy="false"
posted on 2008-02-28 16:04 周锐 阅读(35015) 评论(13)  编辑  收藏 所属分类: Hibernate

只有注册用户登录后才能发表评论。


网站导航: