title: Hibernate JPA, Spring MVC and LazyInitializationException
body: <p>When trying to get items from db, I got this error:</p>
  
  <pre><code>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
  </code></pre>
  
  <p>I understand that with switching to eager instead of lazy loading solves this problem, e.g.</p>
  
  <pre><code>@OneToMany(mappedBy = "myobj", cascade = CascadeType.ALL, fetch=FetchType.EAGER)
  </code></pre>
  
  <p>and I also understand that eager loading is discouraged. What is the best practitce in order to cope with this issue?</p>