`

could not initialize proxy

阅读更多
could not initialize proxy - the owning Session was closed
出现此错误的原因是当Session关闭的时候,在取与用户相关联的对象时候,就会出现此错误,
例如:但Session没有关闭,获得对象User ,用户User与Role之间的关系是多对一,但Session关闭时,再通过User获得Role对象,就会出现下面的错误
10-Mar-2009 10:48:20 org.hibernate.LazyInitializationException <init>
SEVERE: could not initialize proxy - the owning Session was closed
org.hibernate.LazyInitializationException: could not initialize proxy - the owning Session was closed
at org.hibernate.proxy.AbstractLazyInitializer.initialize(AbstractLazyInitializer.java:56)
at org.hibernate.proxy.AbstractLazyInitializer.getImplementation(AbstractLazyInitializer.java:98)
at org.hibernate.proxy.CGLIBLazyInitializer.intercept(CGLIBLazyInitializer.java:158)
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics