Thanx, I will try this out tonight as soon as I get access to the code
again. It seems making the fetchType EAGER is best, as I will access
the filed in all cases, so there is no processing wasted I guess.
Out of my head, this would be the solution I guess (changing to
FetchType.EAGER, LAZY was default)
@OneToMany(mappedBy="tweet", fetch=FetchType.EAGER)
List<ReTweet> retweets
Thanx for your time, I will update this thread later with the result.
Cheerrs
Sven
On Fri, Sep 11, 2009 at 1:14 PM, datanucleus <[email protected]> wrote:
>
>> Related: why are child objects not automatically detached if the
>> parent is detached? Would that not not logical?
>
> JPA doesn't have "fetch groups" as such, just a "default fetch group".
> This is defined by which fields are EAGER loaded. So if you had your
> field marked as EAGER then it would be detached. By default 1-N fields
> are LAZY hence not detached.
>
> The reason we don't just detach child objects is that of where do you
> stop ? Detach a full object graph ? That'd hammer the performance on
> some graphs, hence done using the fetch groups etc.
>
> Try accessing the field before the detach. The log will tell you
> whether/when it is detached.
>
> >
>
--
Sven Haiges
[email protected]
Yahoo Messenger / Skype: hansamann
Personal Homepage, Wiki & Blog: http://www.svenhaiges.de
Subscribe to the Grails Podcast:
http://www.grailspodcast.com
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google App Engine for Java" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/google-appengine-java?hl=en
-~----------~----~----~----~------~----~------~--~---