Commit d9ab77b8 authored by Julien Muchembled's avatar Julien Muchembled

client: drop support for ZODB < 3.10

parent c4b2c78b
......@@ -30,7 +30,7 @@ class Storage(BaseStorage.BaseStorage,
ConflictResolution.ConflictResolvingStorage):
"""Wrapper class for neoclient."""
implements(*filter(None, (
implements(
ZODB.interfaces.IStorage,
# "restore" missing for the moment, but "store" implements this
# interface.
......@@ -41,8 +41,8 @@ class Storage(BaseStorage.BaseStorage,
# ZODB.interfaces.IStorageIteration,
ZODB.interfaces.IStorageUndoable,
ZODB.interfaces.IExternalGC,
getattr(ZODB.interfaces, 'ReadVerifyingStorage', None), # BBB ZODB 3.9
)))
ZODB.interfaces.ReadVerifyingStorage,
)
def __init__(self, master_nodes, name, read_only=False,
compress=None, logfile=None, _app=None, **kw):
......
......@@ -100,10 +100,7 @@ if 1:
# know any legitimate use of DB access outside a transaction.
def afterCompletion(self, *ignored):
try:
self._readCurrent.clear()
except AttributeError: # BBB: ZODB < 3.10
pass
self._readCurrent.clear()
# PATCH: do not call sync()
self._flush_invalidations()
Connection.afterCompletion = afterCompletion
......@@ -641,14 +641,14 @@ class Application(object):
# A later serial has already been resolved, skip.
resolved_serial_set.update(conflict_serial_set)
continue
# BBB: On ZODB < 3.10, tryToResolveConflict returns None
# instead of raising ConflictError.
try:
new_data = tryToResolveConflict(oid, conflict_serial,
serial, data)
except ConflictError:
new_data = None
if new_data is not None:
logging.info('Conflict resolution failed for '
'%r:%r with %r', dump(oid), dump(serial),
dump(conflict_serial))
else:
logging.info('Conflict resolution succeeded for '
'%r:%r with %r', dump(oid), dump(serial),
dump(conflict_serial))
......@@ -660,10 +660,6 @@ class Application(object):
self._store(txn_context, oid, conflict_serial, new_data)
append(oid)
continue
else:
logging.info('Conflict resolution failed for '
'%r:%r with %r', dump(oid), dump(serial),
dump(conflict_serial))
raise ConflictError(oid=oid, serials=(conflict_serial,
serial), data=data)
return result
......
......@@ -62,7 +62,7 @@ def resolving_tryToResolveConflict(oid, conflict_serial, serial, data):
return data
def failing_tryToResolveConflict(oid, conflict_serial, serial, data):
return None
raise ConflictError
class ClientApplicationTests(NeoUnitTestBase):
......
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