Maybe one of the fetches times out and it just silently fails.. And prints out its current count?
On 12/10/09, bsb <b...@pearcomp.com> wrote: > No ideas? Noone? I just don't understand why not all keys are > retrieved every time. It doesn't make any sense... > > Thanks in advance, > Ben > > On Dec 8, 6:47 pm, bsb <b...@pearcomp.com> wrote: >> I am trying to cycle through all elements of a table via the remote >> API, using a modification of the code snippet >> fromhttp://code.google.com/appengine/articles/remote_api.html: >> >> #---------------------------------------------------- SNIP >> ---------------------------------------------------- >> query = db.GqlQuery("SELECT __key__ FROM Model_mobileapp ORDER BY >> __key__") >> apps = query.fetch(500) >> total = 0 >> while apps: >> total = total + len(apps) >> query2 = db.GqlQuery("SELECT __key__ FROM Model_mobileapp WHERE >> __key__ > :1 ORDER BY __key__", apps[-1]) >> apps = query2.fetch(500) >> >> print "%d" % total >> #---------------------------------------------------- SNAP >> ---------------------------------------------------- >> >> However, I'm getting unpredictable behaviour. Sometimes I get the >> correct number (104512), sometimes I get 15999, 30999 and all sorts of >> other values. >> >> Does anyone have any clue what this could be caused by? Is there some >> sort of magic caching going on for the fetch() command, that return >> some keys which are not in the correct sorting order? Could the >> (automatic) ascending key index be broken? Any ideas? >> >> Thanks, >> Ben > > -- > > You received this message because you are subscribed to the Google Groups > "Google App Engine" group. > To post to this group, send email to google-appeng...@googlegroups.com. > To unsubscribe from this group, send email to > google-appengine+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/google-appengine?hl=en. > > > -- Sent from my mobile device -- You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to google-appeng...@googlegroups.com. To unsubscribe from this group, send email to google-appengine+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.