[Neo-report] r2536 vincent - /trunk/neo/client/Storage.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Tue Dec 14 16:57:06 CET 2010
Author: vincent
Date: Tue Dec 14 16:57:06 2010
New Revision: 2536
Log:
Fix transaction isolation for iterator.
Modified:
trunk/neo/client/Storage.py
Modified: trunk/neo/client/Storage.py
==============================================================================
--- trunk/neo/client/Storage.py [iso-8859-1] (original)
+++ trunk/neo/client/Storage.py [iso-8859-1] Tue Dec 14 16:57:06 2010
@@ -185,6 +185,12 @@ class Storage(BaseStorage.BaseStorage,
return 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)
# undo
More information about the Neo-report
mailing list