JBoss Community

Re: ManyToMany bidirectional - inverse side does not load the complete collection

created by Wolfgang Knauf in EJB 3.0 - View the full discussion

Hi Nicole,

 

to my understanding, using "FetchType=EAGER" on both sides is a bit dangerous, because loading an "Appointment" entity would load all related "Offers", and loading those "Offers" would trigger a loading of "Appointments" and so on.

So I assume that Hibernate somehow detects this cycle and stops loading data.

 

Better use FetchType = LAZY with ManyToMany relationships.

 

You might also switch on SQL logging and take a look at the statements. Maybe you will find a hint there.

 

Hope this helps

 

Wolfgang

Reply to this message by going to Community

Start a new discussion in EJB 3.0 at Community