Appengine doesn't store any metadata about your namespaces. The namespace is just one internal part (the second part, right after your appID) of any entity key. To list all namespaces appengine iterates over the entity key index one namespace at a time. Now since index reads are eventually consistent so is your namespace list. To return different results at different times is just normal behaviour under eventual consistency. The result will depend on the actual datastore server that's being hit by your query. After deleting lots of entities I've seen inconsistencies lasting for hours. But they will go away - eventually.
To work around that behaviour you could iterate over the namespace list returned from the API and check if there are entites left in that namespace. To do that you could do a "kindless query" beginning with a key pointing to the lowest possible kind (that's probably the space character) and an id value of zero. There you will retrieve all entities remaining in that namespace, no matter what's their kind since all other keys of that namespace are bigger than your starting key. However that query is eventual consistent again. So you better make that a keys-only query and do a 'get' on every key returned. Since 'get' is strongly consistent you can be sure your namespace still exists if such a call succeeds. One other thing to watch out for are 'statistics entities' that appengine generates on a regular basis to provide usage stats on the admin console. To delete a namespace completely you have to delete them as well. Those kinds have double underscores in the beginning and the end. Wolfram -- You received this message because you are subscribed to the Google Groups "Google App Engine" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/google-appengine. For more options, visit https://groups.google.com/groups/opt_out.
