Hi All
When trying to get items from db, I got this error:
13:00:13.876 [7838526@qtp-204712603-0] ERROR o.h.LazyInitializationException - failed to lazily initialize a collection of role: bo.myobj, no session or session was closed
org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: de.myob.linkedstuff, no session or session was closed
I understand that with switching to eager instead of lazy loading solves this problem, e.g.
@OneToMany(mappedBy = "myobj", cascade = CascadeType.ALL, fetch=FetchType.EAGER)
and I also understand that eager loading is discouraged. What is the best practitce in order to cope with this issue?