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

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

문제

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?

도움이 되었습니까?

해결책

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top