surinder-insonix / datanucleus-appengine

Automatically exported from code.google.com/p/datanucleus-appengine
0 stars 0 forks source link

can't set chunk size for JDO queries (setFetchSize has no effect) #208

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
It looks like there's no way to control the chunk size used by JDO to get query 
data from the datastore. In particular, setFetchSize() has no effect in this 
code:

    Extent<T> extent = pm.getExtent(entityClass, false);
    extent.getFetchPlan().setFetchSize(1000);
    for (T entity : extent) {
      ...
    }

In the source code, it looks like the low-level FetchOptions object is built in 
DatastoreQuery.buildFetchOptions(), and this code doesn't do anything with 
chunk size, so it remains at the default.

Being able to set the chunk size will be particularly important when we add 
support for the remote API, as the default value is too small for remote 
fetches.

Original issue reported on code.google.com by skybr...@google.com on 7 Jun 2010 at 8:51

GoogleCodeExporter commented 8 years ago
There are many entities in the datastore and I want to clear out. Clearing all 
of them at the same time leads to time-out. I want to delete by chunk, however 
it seems that setFetchSize() has no effect.

    Query query = pm.newQuery(AdjacentEntity.class);
    query.getFetchPlan().setFetchSize(numberOfRecord);
    int count = query.deletePersistentAll();
return 'count' is bigger than numberOfRecord. 

Please help. Thanks.

Original comment by dak.ap...@gmail.com on 16 Dec 2010 at 9:36

GoogleCodeExporter commented 8 years ago

Original comment by max.r...@gmail.com on 16 Mar 2011 at 6:12

GoogleCodeExporter commented 8 years ago

Original comment by max.r...@gmail.com on 17 Mar 2011 at 8:11

GoogleCodeExporter commented 8 years ago

Original comment by max.r...@gmail.com on 26 May 2011 at 11:31

GoogleCodeExporter commented 8 years ago

Original comment by max.r...@gmail.com on 20 Sep 2011 at 6:48