Commit 015b87ee authored by Grégory Wisniewski's avatar Grégory Wisniewski

Bug fix. Thread-safe data were not propely initialized


git-svn-id: https://svn.erp5.org/repos/neo/branches/prototype3@546 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 4336dacb
...@@ -36,7 +36,6 @@ class Storage(BaseStorage.BaseStorage, ...@@ -36,7 +36,6 @@ class Storage(BaseStorage.BaseStorage,
format='[%(module)12s:%(lineno)3d] %(message)s' format='[%(module)12s:%(lineno)3d] %(message)s'
logging.basicConfig(level=logging.DEBUG, format=format) logging.basicConfig(level=logging.DEBUG, format=format)
# Transaction must be under protection of lock # Transaction must be under protection of lock
l = Lock()
self.app = Application(master_nodes, name, connector) self.app = Application(master_nodes, name, connector)
def load(self, oid, version=None): def load(self, oid, version=None):
......
...@@ -441,6 +441,9 @@ class Application(object): ...@@ -441,6 +441,9 @@ class Application(object):
def tpc_begin(self, transaction, tid=None, status=' '): def tpc_begin(self, transaction, tid=None, status=' '):
"""Begin a new transaction.""" """Begin a new transaction."""
# dirty, but we need an initialization point for each thread
if getattr(self.local_var, 'txn', None) is None:
self._clear_txn()
# First get a transaction, only one is allowed at a time # First get a transaction, only one is allowed at a time
if self.local_var.txn is transaction: if self.local_var.txn is transaction:
# We already begin the same transaction # We already begin the same 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