Commit a3238bea authored by Vincent Pelletier's avatar Vincent Pelletier

Factorise self.local_var.tid lookup.

git-svn-id: https://svn.erp5.org/repos/neo/trunk@1891 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent ed01601f
......@@ -740,13 +740,14 @@ class Application(object):
return
self._load_lock_acquire()
try:
tid = self.local_var.tid
# Call function given by ZODB
if f is not None:
f(self.local_var.tid)
f(tid)
# Call finish on master
oid_list = self.local_var.data_dict.keys()
p = Packets.AskFinishTransaction(oid_list, self.local_var.tid)
p = Packets.AskFinishTransaction(oid_list, tid)
self._askPrimary(p)
if not self.isTransactionFinished():
......@@ -761,11 +762,11 @@ class Application(object):
del self.mq_cache[oid]
else:
# Now serial is same as tid
self.mq_cache[oid] = self.local_var.tid, data
self.mq_cache[oid] = tid, data
finally:
self._cache_lock_release()
self.local_var.clear()
return self.local_var.tid
return tid
finally:
self._load_lock_release()
......
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