Commit ad3e2e8a authored by Aurel's avatar Aurel

set self.txn the latest as possible thus if connection to a node failed

in tpc_begin, all other call to storage method will return without error


git-svn-id: https://svn.erp5.org/repos/neo/branches/prototype3@232 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 75603e10
......@@ -418,11 +418,12 @@ class Application(object):
if self.txn == transaction:
# We already begin the same transaction
return
self.txn = transaction
# Get a new transaction id if necessary
if tid is None:
self.tid = None
conn = self.master_conn
if conn is None:
raise NEOStorageError("Connection failed")
conn.lock()
try:
msg_id = conn.getNextId()
......@@ -433,13 +434,13 @@ class Application(object):
self.dispatcher.register(conn, msg_id, self.getQueue())
finally:
conn.unlock()
# Wait for answer
self._waitMessage(conn, msg_id)
if self.tid is None:
raise NEOStorageError('tpc_begin failed')
else:
self.tid = tid
self.txn = transaction
def store(self, oid, serial, data, version, 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