How do I make app engine retrieve an attribute value from the datastore instead of the memcache?

StackOverflow https://stackoverflow.com/questions/20435142

Question

I'm writing a post method that updates an attribute value and then displays the entities with the updated attribute value. I'm using ndb.

When I run app engine and refresh the localhost, the memcache value is retrieved instead of the newly updated attribute value. I want the browser to display the newly updated attribute value; how do I stop the memcache retrieval?

Était-ce utile?

La solution

A query within appengine is not consistent unless your data is structured to be strongly consistent. If it is not, then you will will see inconsistent results as per what you are describing: See the docs for further info, or look around on stackoverflow as there are many posts that outline this exact issue: https://developers.google.com/appengine/docs/python/datastore/structuring_for_strong_consistency

To resolve this issue, retrieve the data that you wish to display with a get(). eg: your_entity.key.get(): https://developers.google.com/appengine/docs/python/ndb/entities

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top