There's JDO documentation on Arrays which describes somewhat similar
behavior - 
http://www.datanucleus.org/products/accessplatform/jdo/orm/arrays.html:

-- Quote --
JDO has no simple way of detecting changes to an arrays contents. To
update an array you must either
replace the array field with the new array value
update the array element and then call JDOHelper.makeDirty(obj,
"fieldName");
-----------

Using JDOHelper does resolve my issue.  However this doesn't fully
explain why:
- This happens w/ List and HashSet, which I'd expect to be "smarter"
since JDO backing subclasses are available
- Some cases (adds, remove-leaving-one) work fine w/o using either of
the two recommended work-arounds

I should note that I'm also using detachOnClose.




On Jul 1, 1:37 pm, James <jamesk...@gmail.com> wrote:
> I'm seeing some odd behavior now that I've switched to properly
> detached objects (previously I was calling detachCopy but didn't have
> my classes marked w/ the detachable annotation).
>
> Given an entity that contains a List<Key>, I can save a new entity w/
> one key in the list.  However if I remove that item from the list,
> persist, and retrieve again, the removed item is still there.
>
> I can work around this by replacing my List w/ an entirely new List
> object that is empty.  Then it persists correctly.
>
> Oddly, I do NOT need to create a new List object, and things work okay
> if:
> - I'm adding to the list or
> - I'm removing from the list but leaving one item in it
>
> There are a number of GAE and Datanucleus issues logged, but none of
> them directly hit on this, so I thought I'd post it and see if I'm
> going crazy...

-- 
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