I am using a static factory in my parent object to construct that
object, initialize its children, and then start a task for each of
them to round out their construction (which is mildly computationally
laborious).  However, my task is failing to load the children, and I
was hoping to find some insight as to why.

The factory method:

    public static DynamicInverse make(User owner, List<Integer>
dynamic, int size) {
        DynamicInverse result = new DynamicInverse(owner,dynamic,size);
        PersistenceManager pm = PersistenceSource.get();
        Transaction tx = pm.currentTransaction();

        try {
            tx.begin();
            result = pm.makePersistent(result);
            for (int i=0; i<size; pm.makePersistent(new
VertexInverse(result,BankerOrder.INTEGER.bitmask(i++))));
                pm.close();
            tx.commit();
        } finally {
            if (tx.isActive()) { tx.rollback(); result=null; }
        }

        if (result!=null) {
                Queue q = QueueFactory.getDefaultQueue();
                for (VertexInverse vi : result.getInverse()) {
                        q.add(url("/task/inversion").param("key",
KeyFactory.keyToString(vi.getKey())).method(Method.PUT));
                }
        }

        return result;
    }

and in the servlet up to where it fails:

        public void doPut(HttpServletRequest request, HttpServletResponse
response) throws IOException, ServletException {
                PersistenceManager pm = PersistenceSource.get();

                VertexInverse vi = pm.getObjectById(VertexInverse.class,
KeyFactory.stringToKey(request.getParameter("key")));

The log is complaining:

Could not retrieve entity of kind VertexInverse with key
VertexInverse(24)
org.datanucleus.exceptions.NucleusObjectNotFoundException: Could not
retrieve entity of kind VertexInverse with key VertexInverse(24)

however, it's passed only after persisting, and I can see the data
just fine in the developer admin view.

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" 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?hl=en.

Reply via email to