-
Notifications
You must be signed in to change notification settings - Fork 19
Description
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.