This commit is contained in:
Kovid Goyal 2013-07-30 11:55:58 +05:30
parent 47b927f5bc
commit 4dbf49855a

View File

@ -1142,6 +1142,9 @@ class Cache(object):
if extra is not None or force_changes:
protected_set_field(idx, extra)
except:
# sqlite will rollback the entire transaction, thanks to the with
# statement, so we have to re-read everything form the db to ensure
# the db and Cache are in sync
self._reload_from_db()
raise