错误异常:
08:42:43,546 ERROR LazyInitializationException:19 - 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:60)
at org.hibernate.proxy.AbstractLazyInitializer.getImplementation(AbstractLazyInitializer.java:111)
at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:172)
解决方案:
hibernate默认是延迟加载,而导致无法将集合类中数据读取出来
则可以在相应pojo对应的hbm.xml文件里做出相关修改
1 可以在hibernate-mapping标签中设置属性default-lazy="false"
2 也可以在class标签中设置属性lazy="false"
以上都可以解决问题
分享到:
相关推荐
The availability of drivers that support the features of the specification will simplify the process of developing Windows appli¬cation programs that in-corporate absolute coordinate input, and ...
Cohen-Game-Of-Chromes-Owning-The-Web-With-Zombie-Chrome-Extensions-wp
us-17-Cohen-Game-Of-Chromes-Owning-The-Web-With-Zombie-Chrome-Extensions-wp
「安全资讯」hta-t07_modern-exploitation-owning-all-of-the-things - 数据安全 漏洞分析 漏洞预警 WEB应用防火墙 工控安全 安全管理
信息安全_数据安全_Owning Your Professional Narrative 内网安全 安全加固 数字取证 安全工作 安全运营
The utility industry has made great progress in grid transformation and modernization since the rst edition of this book was published in 2012. In my view, one of the most signi cant changes has been ...
The top window always shows a list of the currently active processes, including the names of their owning accounts, whereas the information displayed in the bottom window depends on the mode that ...
The top window always shows a list of the currently active processes, including the names of their owning accounts, whereas the information displayed in the bottom window depends on the mode that ...
该文档描述了jemalloc的数据结构及其实现
With the acquisition of Hyperion Systems in 2007, Oracle finds itself owning the two most capable OLAP products on the market--Essbase and the OLAP Option to the Oracle Database. Written by the most ...
The top window always shows a list of the currently active processes, including the names of their owning accounts, whereas the information displayed in the bottom window depends on the mode that ...
fport reports all open TCP/IP and UDP ports and maps them to the owning application. This is the same information you would see using the 'netstat -an' command, but it also maps those ports to running...
该项目正在进行中除非产品上有此标记或出现在上,否则问题或本回购中所呈现的任何内容都不是最终产品。 某些副本或公式可能会替换为伪文本,以确保我们遵循CFPB的所有隐私和安全程序。 我们决策过程的所有设计,布局...
The Ones Complement Operator The Left Shift Operator 216 The Right Shift Operator 216 Exercises 217 11 Categories and Protocols 219 Categories 219 Class Extensions 224 214 Some Notes About Categories ...
Active Ports maps ports to the owning application so you can watch which process has opened which port. It also displays a local and remote IP address for each connection and allows you to ...
fport reports all open TCP/IP and UDP ports and maps them to the owning application. This is the same information you would see using the 'netstat -an' command, but it also maps those ports to running...
As of November 2017, the total market cap of all cryptocurrencies stands at around $200 Billion USD. This is in comparison to a mere $40 Billion market cap at the beginning of the year, and a stunning...