Commit 97e57031 authored by Julien Muchembled's avatar Julien Muchembled

client: make tpc_vote computes its return value only if successful

parent 5ae69542
...@@ -533,15 +533,11 @@ class Application(ThreadedApplication): ...@@ -533,15 +533,11 @@ class Application(ThreadedApplication):
_waitAnyTransactionMessage(txn_context) _waitAnyTransactionMessage(txn_context)
if txn_context['data_dict']: if txn_context['data_dict']:
raise NEOStorageError('could not store/check all oids') raise NEOStorageError('could not store/check all oids')
if OLD_ZODB:
return [(oid, ResolvedSerial)
for oid in txn_context['resolved_dict']]
return txn_context['resolved_dict']
def tpc_vote(self, transaction): def tpc_vote(self, transaction):
"""Store current transaction.""" """Store current transaction."""
txn_context = self._txn_container.get(transaction) txn_context = self._txn_container.get(transaction)
result = self.waitStoreResponses(txn_context) self.waitStoreResponses(txn_context)
ttid = txn_context['ttid'] ttid = txn_context['ttid']
packet = Packets.AskStoreTransaction(ttid, str(transaction.user), packet = Packets.AskStoreTransaction(ttid, str(transaction.user),
str(transaction.description), dumps(transaction._extension), str(transaction.description), dumps(transaction._extension),
...@@ -583,7 +579,10 @@ class Application(ThreadedApplication): ...@@ -583,7 +579,10 @@ class Application(ThreadedApplication):
# - If possible, recover from master failure. # - If possible, recover from master failure.
if 'error' in txn_context: if 'error' in txn_context:
raise NEOStorageError(txn_context['error']) raise NEOStorageError(txn_context['error'])
return result if OLD_ZODB:
return [(oid, ResolvedSerial)
for oid in txn_context['resolved_dict']]
return txn_context['resolved_dict']
def tpc_abort(self, transaction): def tpc_abort(self, transaction):
"""Abort current transaction.""" """Abort current transaction."""
......
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