Having @ManyToMany(fetch=FetchType.EAGER) attributes can slow down retrieval quite significantly (up to 40 times slower).
I recall reading somewhere that FetchType.EAGER is the default for @ManyToMany associations. Also, from experience I noticed that setting FetchType.LAZY caused a org.hibernate.LazyInitializationException thrown with exception message similar to, failed to lazily initialize a collection of role: com.xyz.domain.EntityOne.images, no session or session was closed.











Comments