Lazy/Eager loading strategies in remoting cases (JPA)

后端 未结 3 1228
予麋鹿
予麋鹿 2020-12-05 05:47

I\'m running into LazyLoading exceptions like the most people who try remoting with an ORM. In most cases switching to eager fetching solves the problem (Lazy Loading / Non

3条回答
  •  旧时难觅i
    2020-12-05 06:31

    Although it takes a bit of work and for JAX-WS/JAXB requires recent versions of those libraries, this is a very elegant solution: create a marshaller that can test for whether objects / collections have been initialized.

    As described here: https://forum.hibernate.org/viewtopic.php?f=1&t=998896

提交回复
热议问题