Whenever I query something like

    public static MyUser getUserInfo(Key userKey) {
        PersistenceManager pm = PMF.get().getPersistenceManager();
        MyUser myUser, detached = null;
        try {
            myUser = pm.getObjectById(MyUser.class, userKey);
            pm.detachCopy(myUser.getAvatar()); // little worried about
this, but fixes the error
            detached = pm.detachCopy(myUser);
        } finally {
            pm.close();
        }
        return detached;
    }

before closing the PM I detach the object so that I can use the result
of the query after closing the PM. This works fine, however it becomes
a little crazy when my Objects contain child objects that need to be
detached as well.

Is there a better way of getting information from a query without
having to go through the entire result and detach all the objects?

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