Commit de7ccf2d authored by Vincent Pelletier's avatar Vincent Pelletier

Restore backward-compatibility with ZODB 3.4.

git-svn-id: https://svn.erp5.org/repos/neo/trunk@2798 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent aebcf4a4
......@@ -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.
......
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