Can you try using  @PersistentMap(elementCascade =
CascadeType.PERSIST,fetch=FetchType.EAGER) rather than @ElementCollection? I
don't see the N+1 select problem in my tests when using the persistentmap
annotation.

Thanks,
Rick

On Wed, Feb 16, 2011 at 8:36 AM, Henno Vermeulen <[email protected]>wrote:

> When I have a Map inside a TestEntity (mapped either with @OneToMany or
> @ElementCollection), OpenJPA 2 always performs N + 1 selects when I do the
> simple query "SELECT z FROM TestEntity z".
>
> A solution to this would of course be great, but I would also be very happy
> if an OpenJPA developer could quickly try this out and confirm to me whether
> or not this is indeed an issue with OpenJPA or that it is simply expected
> behavior.
>
> Regards,
> Henno Vermeulen
>
> (p.s. I have tried many settings and the problem occurs no matter what I
> try. See https://issues.apache.org/jira/browse/OPENJPA-1920 and my
> unanswered post "preventing N+1 select performance problem on maps").
>
>

Reply via email to