Hibernate3 错误: could not initialize proxy - no Session
异常:
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"
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"
版权声明:本文为博主原创文章,未经博主允许不得转载。