Commit b9cded14 authored by Tim Peters's avatar Tim Peters

Revert extra copying in Connection._rollback().

Since TmpStore.reset() had to change too to copy the index anyway,
it no longer hurts that _rollback() clears the index (as a side
effect of self._cache.invalidate(src.index)).
parent 5eb8844d
......@@ -1043,13 +1043,7 @@ class Connection(ExportImport, object):
self._abort()
self._registered_objects = []
src = self._storage
# Caution: it's possible that src.index is part of `state`, and
# invalidate() clears the container passed to it. When rollback() is
# called on the same savepoint more than once, that's even likely.
# Therefore we must pass a copy of the oids to invalidate, lest
# we next reset `src` to have an empty index: the ".keys()" here
# is vital.
self._cache.invalidate(src.index.keys())
self._cache.invalidate(src.index)
src.reset(*state)
def _commit_savepoint(self, transaction):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment