Hello,

I am running app engine plugin 2.0 RC2 and having the following problem:
The following code runs and returns null but...

    PersistenceManager pm = PMF.get().getPersistenceManager();

    try {

      Extent<XZStore> storeExtent = pm.getExtent(XZStore.class);

      if (storeExtent == null) return null; // should not be null but check
just in case

      storeExtent.closeAll();

      return null;

    } finally {

      pm.close();

    }

but iterating over the extent instance throws a NullPointerException
even with an empty loop body:

    PersistenceManager pm = PMF.get().getPersistenceManager();

    try {

      Extent<XZStore> storeExtent = pm.getExtent(XZStore.class);

      if (storeExtent == null) return null; // should not be null but check
just in case

      for (XZStore store : storeExtent) {

      }

      storeExtent.closeAll(); // line 223 where null pointer exception is
thrown

      return null;

    } finally {

      pm.close();

    }

---------------------------------------------------------------------------------

import com.google.appengine.api.datastore.Key;

@PersistenceCapable(detachable="true")
class XZStore {

  @PrimaryKey
  @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
  private Key key;

  // ...

}


There are no instances of XZStore in the datastore so I don't know why
this is happening, I would have thought the loop would simply be skipped
without a problem.

java.lang.NullPointerException
    at
com.google.appengine.datanucleus.query.StreamingQueryResult.cacheQueryResults(StreamingQueryResult.java:101)
    at
com.google.appengine.datanucleus.query.StreamingQueryResult.closeResults(StreamingQueryResult.java:94)
    at
org.datanucleus.store.query.AbstractQueryResult.close(AbstractQueryResult.java:137)
    at org.datanucleus.store.query.Query.close(Query.java:2126)
    at org.datanucleus.store.query.Query.closeAll(Query.java:2141)
    at
org.datanucleus.store.DefaultCandidateExtent.closeAll(DefaultCandidateExtent.java:102)
    at org.datanucleus.api.jdo.JDOExtent.closeAll(JDOExtent.java:66)
    at com.foobar.foo.Data.getStoreByEmail(Data.java:223)

I was not having this problem prior to upgrading to 2.0 RC2. Any ideas of
why this behavior?

Is this a bug or am I doing something wrong?

Thanks,

JG

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