还是关于could not initialize proxy - no Session的问题
hibernate2与hibanete3在lazy的默认值上有区别:2中默认为lazy="false".而三中默认为proxy,我们可以把它看作是true.
异常:
程序代码
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)
hibernate2与hibanete3在lazy的默认值上有区别:2中默认为lazy="false".而三中默认为proxy,我们可以把它看作是true.
异常:
程序代码
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)