Try to invoke the method of the JDO entity to set the Boolean value. Not
just change the field value.
Ex:
public void setValid(Boolean valid) {
this.valid = valid;
}
On Tue, Jun 28, 2011 at 3:31 PM, ThePablick <[email protected]> wrote:
> Fixed. The problem was pretty strange however, I loaded the Token from
> datastore, one of it’s fields was the owning User instance, and that
> instance had a Set of Tokens, which I loaded as well… but after
> setting the valid flag. So loading the instance again kind of
> destroyed changes made up to that point.
>
> What would solve it? A transaction commit before loading the set of
> all user’s tokens?
>
>
>
> On Jun 27, 9:08 pm, ThePablick <[email protected]> wrote:
> > Hello,
> >
> > I’ve just run into a problem I don’t know how to solve right now: I
> > have this class named i.e. "Token", one endpoint in web.xml for a
> > class that manipulates this @PersistenceCapable class with @Persistent
> > private Boolean field named "valid".
> >
> > What the endpoint class does: it either stores a new Token instance by
> > making it persistent, based on POST data, by making it persistent by
> > the .makePersistent() call. Then, for another kind of POST data, it
> > loads the Token instance and calls a method called "invalidate" on it,
> > which basically just sets the valid field to Boolean.FALSE (instead of
> > Boolean.TRUE with which it was previously persisted).
> >
> > Besides this, I have a simple Java program that makes calls to the
> > endpoint, with some delay in between each request. It all works well,
> > well, except for one point: when I check the datastore viewer, there
> > is no "valid" field set to false, even though that endpoint call was
> > indeed made. But I can see that the Token instance was updated,
> > because of the OPT_VERSION field added by @Version(strategy =
> > VersionStrategy.VERSION_NUMBER).
> >
> > Anyone has an idea where the error might be?
>
> --
> 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.
>
>
--
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.