[Neo-report] r2798 vincent - /trunk/neo/client/__init__.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Wed Jun 22 19:01:13 CEST 2011
Author: vincent
Date: Wed Jun 22 19:01:13 2011
New Revision: 2798
Log:
Restore backward-compatibility with ZODB 3.4.
Modified:
trunk/neo/client/__init__.py
Modified: trunk/neo/client/__init__.py
==============================================================================
--- trunk/neo/client/__init__.py [iso-8859-1] (original)
+++ trunk/neo/client/__init__.py [iso-8859-1] Wed Jun 22 19:01:13 2011
@@ -24,7 +24,8 @@ if needs_patch:
"""Indicate confirmation that the transaction is done."""
def callback(tid):
- if self._mvcc_storage:
+ # BBB: _mvcc_storage not supported on older ZODB
+ if getattr(self, '_mvcc_storage', False):
# Inter-connection invalidation is not needed when the
# storage provides MVCC.
return
@@ -38,7 +39,11 @@ if needs_patch:
serial = self._storage.tpc_finish(transaction, callback)
if serial is not None:
assert isinstance(serial, str), repr(serial)
- for oid_iterator in (self._modified, self._creating.iterkeys()):
+ creating = self._creating
+ # BBB: List on older ZODB, dict on newer
+ if isinstance(creating, dict):
+ creating = self._creating.iterkeys()
+ for oid_iterator in (self._modified, creating):
for oid in oid_iterator:
obj = self._cache.get(oid, None)
# Ignore missing objects and don't update ghosts.
More information about the Neo-report
mailing list