>Are you using GWT?
Yes, I am using GWT
But I found a solution to the problem.
A work-around is as follows:
When an element from the index list is removed, I check if the list is
empty. When the list is empty, I create a new empty list and overwrite
the old list with the new. This works in local mode. In production I
have not tested it yet, but will do it as soon as possible. For now
this solution works fine...
...
index.getIdList().remove(action.getId());
if(index.getIdList().isEmpty()) {
index.setIdList(new ArrayList<String>());
}
...
pm.makePersistent(IndexClass);
...
On 9 Sep., 14:56, James <[email protected]> wrote:
> I posted on similar issues here
> -http://groups.google.com/group/google-appengine-java/browse_thread/th...
>
> After spending (wasting) several days experimenting w/ the combination
> of detached and owned entities, my apps now work fine, but I always
> need to call JDOHelper.makeDirty before persisting to get things
> working properly. Otherwise I get special-case bugs saving an empty
> list, or a list w/ one item in it.
>
> So try JDOHelper.makeDirty(enhtityInstance, propertyNameAsString); and
> let us know if that helps.
>
> J
>
> On Sep 8, 5:50 am, androidDeveloper <[email protected]> wrote:
>
> > Hi all,
>
> > I read the post
>
> >http://groups.google.com/group/google-appengine-java/browse_thread/th...
>
> > which describes a problem with the local datastore and empty lists.
>
> > This problem seems to be fixed. But maybe I have found another one.
>
> > I have a list "List<String> favoritesUserId" in a index class to which
> > I can add or remove keys (encoded Strings). So there is the
> > possibility, that the list gets empty, after all items are removed.
> > The class is a child of another class. The structure is kind of the
> > index-class pattern introduced by Bret Slatkin (Building Scalable,
> > complex Apps on App engine)
>
> > So here is the problem. When I try to save an item in the list, it
> > works fine. Removing items works fine too, as long the list after
> > removing the item is not empty. When I remove the last item and save
> > the object, the last item stays in the list. I have not tried it in
> > production yet, cause I am not ready for testing prod. Maybe this is a
> > local problem with the SDK?
>
> > Does anyone know what the solution to this problem is?
>
> > 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 [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.