According to: 
http://code.google.com/intl/de-DE/appengine/docs/java/datastore/creatinggettinganddeletingdata.html#Keys

=> "If the app creates a new object and gives it the same string ID as
another object of the same kind (and the same entity group parent),
saving the new object overwrites the other object in the datastore."

I would like to do exactly the same to update an existing entity by
calling makePersistent() and assigning an existent id/key! The update
works fine except for nested objects! The nested objects are appended
(added) to the old ones instead of being replacing them? I don't know
if this is the intended behaviour or if this is a bug? I expect
overwriting to have the same effect as inserting a new entity!

This thread discusses exactly the same issue:
http://stackoverflow.com/questions/1482570/updating-nested-objects-with-jdo-on-google-app-engine

But it seems they have not reached a conclusion yet!

Another idea:
How about achieving an update by first deleting the old entity and
persisting the new one in the same transaction? Does this work? I
tried this but it resulted in deleting the entity completely?! I don't
know why (even though I tried flushing directly after calling deleting
& calling makePersistent() after flushing)!

-- 
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-j...@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