title: org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role:ticketCircuitInfo, could not initialize proxy - no Session
body: <p>I have 2 bean classes(<code>ticketEntity</code>, <code>ticketCircuitInfo</code>) mapped to 1 table each</p>
  
  <p>I also have 1 <code>ticketEntity(primary key)</code> that can have multiple <code>ticketCircuitInfo(forign key)</code></p>
  
  <p>The <code>ticketEntity</code> bean has the following properties:</p>
  
  <pre><code>@Id
  @Column(name = "ticket_id", unique = true, nullable = false)
  private String ticketId;
  @OneToMany(fetch = FetchType.LAZY, mappedBy = "ticket", cascade      =CascadeType.ALL)
  private Set&lt;TicketCircuitInfo&gt; ticketCircuitInfo;
  </code></pre>
  
  <p>The ticketCircuitInfo bean has the following properties:</p>
  
  <pre><code>@GenericGenerator(name = "generator", strategy = "foreign",
  parameters = @Parameter(name = "property", value = "ticket"))
  @Id
  @Column(name = "ticket_id", unique = true, nullable = false)
  private String ticketId;
  @ManyToOne(fetch = FetchType.LAZY)
  @PrimaryKeyJoinColumn
  private TicketEntity ticket;`
  </code></pre>
  
  <p>I'm getting:</p>
  
  <blockquote>
    <p>com.sun.jdi.InvocationException occurred invoking method.</p>
  </blockquote>
  
  <p>While debugging on the line <code>ticket.ticketCircuitInfo()</code>. </p>
  
  <p>further exception being printed is:</p>
  
  <blockquote>
    <p>org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role:ticketCircuitInfo, could not initialize proxy - no Session</p>
  </blockquote>