geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Fredrik Jonson <>
Subject Re: Unexpected behaviour from @OneToMany with FetchType.LAZY (SOLVED)
Date Wed, 18 Mar 2009 07:58:12 GMT
I wrote:

>  I can't get my @OneToMany references with FetchType.LAZY to become
>  populated by openjpa in geronimo. Using FetchType.EAGER works as
>  expected. Using OpenJPA standalone (in unit tests) and
>  transaction-type=LOCAL works too. But when I deploy the code in
>  geronimo my LAZY-fetched OneToMany relations are not populated.

False alarm. After poking around a bit more I noticed that the calling
code wasn't in a transaction. The customer entity was detached from the
entity manager long before the lazy-loaded resource had been populated.

BTW, while pondering I found a excellent introduction to JPA transactions:

Sorry for the noise.

Fredrik Jonson

View raw message