title: How to solve the LazyInitializationException when using JPA and Hibernate
body: <p>I am working on a project for a customer who wants to use lazy initialization.
  They always get "lazy initialization exception" when mapping classes with the default lazy loading mode.</p>
  
  <pre><code>@JoinTable(name = "join_profilo_funzionalita", joinColumns = {@JoinColumn(name =    "profilo_id", referencedColumnName = "profilo_id")}, inverseJoinColumns = {@JoinColumn(name = "funzionalita_id", referencedColumnName = "funzionalita_id")})
  //@ManyToMany(fetch=FetchType.EAGER) - no exceptions if uncommented
  @ManyToMany 
  private Collection&lt;Funzionalita&gt; funzionalitaIdCollection;
  </code></pre>
  
  <p>Is there a standard pattern using JPA classes to avoid this error?</p>
  
  <p>Snippets are welcome, thanks a lot for your time. </p>