Commit 2b56bbbd authored by Grégory Wisniewski's avatar Grégory Wisniewski

Use _clear_txn in __init__ to avoid code duplication.


git-svn-id: https://svn.erp5.org/repos/neo/branches/prototype3@526 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 2f46a9cc
......@@ -205,13 +205,7 @@ class Application(object):
self.storage_handler = StorageEventHandler(self, self.dispatcher)
# Internal attribute distinct between thread
self.local_var = local()
self.local_var.txn = None
# Transaction specific variable
self.local_var.data_dict = {}
self.local_var.object_stored = 0
self.local_var.txn_voted = False
self.local_var.txn_finished = False
self.local_var.tid = None
self._clear_txn()
# Lock definition :
# _load_lock is used to make loading and storing atomic
lock = Lock()
......@@ -545,7 +539,8 @@ class Application(object):
"""Clear some transaction parameters."""
self.local_var.tid = None
self.local_var.txn = None
self.local_var.data_dict.clear()
self.local_var.data_dict = {}
self.local_var.object_stored = 0
self.local_var.txn_voted = False
self.local_var.txn_finished = False
......
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