python - Newly added record in datastore is not reflecting in the application -


i have been facing problem in app engine. new app engine, don't know whether doing right way or not.

whenever new record inserted datastore, newly inserted record doesn't reflect in application. appear after next reload.

this simple code: adding user , printing users user table:

def add_user(name):     u = user(name = name)     u.put()     all_users = [u.name u in user.all().order('name')]     #on printing 'all_users', doesn't show added user 

is common behaviour in app engine. take time add new record in datastore? there wrong in way record inserted? please help..

you should never consider using sleep.

what seeing "eventual consistency" in hrd. have read of "structuring data strong consistency" https://developers.google.com/appengine/docs/python/datastore/structuring_for_strong_consistency describes strategies making consistent queries.

as aside, if have put() user entity, don't need query it, have it.


Comments

Popular posts from this blog

php - Why I am getting the Error "Commands out of sync; you can't run this command now" -

linux - Does gcc have any options to add version info in ELF binary file? -

java - Are there any classes that implement javax.persistence.Parameter<T>? -