LazyInitializationException Within a @Transactional Method

隐身守侯 提交于 2019-11-29 10:39:54

This is already answered, but just wanted to post an alternative answer which worked for me in a similar case - for future generations ;)

In my case the issue was caused by the fact that the instance which contained the lazy-loaded collection had been manually evicted (all within transaction boundaries).

Having <tx:annotation-driven /> in my configuration file and using a Spring-managed version of my service class (to call the displayAddresses() method) did the trick.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!