You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a Store instance in process A has an Item instance cached in its objectCache, changes to the underlying database row in process B will not be reflected unless the cache entry expires. In some cases, this may never happen, resulting in the stale Item being cached until the Store instance in process A is closed/reopened, or process A is restarted, etc.
Based on the comment on line 1750, "# XXX do checks on consistency between attrs and DB object, maybe?", it seems possible to compare the values returned from the database with the attributes of the cached Item instance, and if they do not match, update the Item instance in-place.
Alternately, we could just uncache the Item instance and raise KeyError, which would cause a new Item instance to be created via the call to existingInStore. I think I prefer the "update in-place" solution myself.
The text was updated successfully, but these errors were encountered:
When a Store instance in process A has an Item instance cached in its objectCache, changes to the underlying database row in process B will not be reflected unless the cache entry expires. In some cases, this may never happen, resulting in the stale Item being cached until the Store instance in process A is closed/reopened, or process A is restarted, etc.
Based on the comment on line 1750, "# XXX do checks on consistency between attrs and DB object, maybe?", it seems possible to compare the values returned from the database with the attributes of the cached Item instance, and if they do not match, update the Item instance in-place.
Alternately, we could just uncache the Item instance and raise KeyError, which would cause a new Item instance to be created via the call to existingInStore. I think I prefer the "update in-place" solution myself.
The text was updated successfully, but these errors were encountered: