Many thanks, Rick, for bringing to my attention these apparently useful
alternatives! I hopefully will find time to try them.

Thanks,

Peter

On Mon, Jan 2, 2012 at 9:00 PM, Rick Mangi <r...@broadcastr.com> wrote:

> Do yourself a big favor and run away from JDO + GAE screaming as fast
> as you can. You're much better off using one of the thin wrappers
> around the AppEngine Datastore like Objectify or Twig along with the
> built in Memcache service.
>
> JDO was designed for relational data models, GAE was designed for the
> opposite. They don't play well together. You *can* get them to work,
> and many have, but I have yet to find anyone who enjoyed the
> experience.
>
> best,
>
> Rick
>
>
> On Jan 1, 7:07 pm, The night manager <peter.dunay.kov...@gmail.com>
> wrote:
> > Hi,
> >
> > I am new to both GAE and JDO. I would be grateful if someone could
> provide
> > guidance on a behavior I find rather counter-intuitive. In the following
> > code, I have to call pm.evictAll() to successfully/persistently change
> > properties (labels) on a freshly persisted object (bookmark):
> >
> > PersistenceManager pm = PMF.get().getPersistenceManager();
> > try {
> > Bookmark bookmark = new Bookmark(url);
> > bookmark = pm.makePersistent(bookmark);
> > pm.evictAll();
> > Key k = bookmark.getKey();
> > bookmark = pm.getObjectById(Bookmark.class, k);
> > bookmark.addLabels(labels);
> >
> > } finally {
> > pm.close();
> > }
> >
> > I'd naively expect the above code to persistently adding labels to
> bookmarkseven without calling
> > pm.evictAll()and with explicitly (re-)fetching the bookmark object. I'd
> > expect JDO to "notice" that the Bookmark instance has been "dirtied" and
> > pm.close() to persist the changes to the cached object.
> >
> > I find it also counter-intuitive that pm.evict(bookmark) doesn't work --
> > the entire cache needs to be cleared for new labels on bookmark to get
> > persisted. (Even though pm.evict(Object) appears to expect a *
> > persistent-clean* object, which, in turn, appears to assume being in a
> > transaction...)
> >
> > Any pointers on the reasons of this behavior will be gratefully
> appreciated.
> >
> > Peter
>
> --
> 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.
>
>

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