Commit eeaa661c authored by Vincent Pelletier's avatar Vincent Pelletier

Fix transaction isolation for iterator.

git-svn-id: https://svn.erp5.org/repos/neo/trunk@2536 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 7db1fad6
...@@ -185,6 +185,12 @@ class Storage(BaseStorage.BaseStorage, ...@@ -185,6 +185,12 @@ class Storage(BaseStorage.BaseStorage,
return None return None
def iterator(self, start=None, stop=None): def iterator(self, start=None, stop=None):
# Iterator lives in its own transaction, so get a fresh snapshot.
snapshot_tid = self.lastTransaction()
if stop is None:
stop = snapshot_tid
else:
stop = min(snapshot_tid, stop)
return self.app.iterator(start, stop) return self.app.iterator(start, stop)
# undo # undo
......
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