Thanks for the replies.

@Didier - I have considered this, and I guess I will have to manually
delete each entity if I cant find a more elegant solution, however
going by what the documentation says it should just work. I'd like to
find out why this exception is occurring if possible.

@Nichole - I currently have an unowned one to many relationship and
don't really need an owned one, having said that could this make a
difference? I will have to try and see when I get time.

Thanks again

On Jun 6, 5:27 am, Didier Durand <durand.did...@gmail.com> wrote:
> Hi,
>
> As a workaround, why don't you delete each entity in the set in a loop
> by yourself before deleting the entity which the set is part of ?
>
> regards
>
> didier
>
> On Jun 6, 1:48 am, mscwd01 <mscw...@gmail.com> wrote:
>
>
>
>
>
>
>
> > Hey,
>
> > I have a "parent" entity which has a Set of "child" entities, as
> > follows:
>
> > class Parent {
>
> > @Persistent @Element(dependent = "true")
> > private Set<Child> children;
>
> > }
>
> > When I delete the "Parent" entity I get the following exception:
>
> > javax.jdo.JDOUserException: Cannot read fields from a deleted object
> > FailedObject:com.google.appengine.api.datastore.Key:Parent("100034534545656 
> > 7676")/
> > Child(2)
>
> > It seems JDO deletes the "Parent" entity before the "Child" objects in
> > the dependent Set property, which causes the above exception to appear
> > when the Child entities in the Set are themselves deleted. Does anyone
> > know how to solve this issue?
>
> > FYI when I delete the parent entity I use pm.deletePersistent() within
> > a transaction.
>
> > Thanks

-- 
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 google-appengine-java@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.

Reply via email to