summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/prserv/db.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2013-08-28 16:06:10 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-08-29 00:13:22 +0100
commit06d76645900b2a7db8f88a0ad3bf4ae66cef52f1 (patch)
tree5e0f585113a974e1207374ae23f44c0b79db63d3 /bitbake/lib/prserv/db.py
parent5fba9d8c6c9982f59b0285fe17e91e162e25d495 (diff)
downloadpoky-06d76645900b2a7db8f88a0ad3bf4ae66cef52f1.tar.gz
bitbake: prserv/db: Threading fixes
Enabling threading for the PRServer causes a number of issues. Firstly is the obtuse error: sqlite3.InterfaceError: Error binding parameter 0 - probably unsupported type which is due to the class not being derived from object. See: http://docs.python.org/2/library/sqlite3.html#registering-an-adapter-callable Secondly, we want to enable multithreadded access to the database so we do this when we open it. This opens the way up to multithreading the PR server. (Bitbake rev: 5709efc2ff1e36529bd28f49cd093ccfa7abff7f) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/prserv/db.py')
-rw-r--r--bitbake/lib/prserv/db.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/bitbake/lib/prserv/db.py b/bitbake/lib/prserv/db.py
index 9d8e9db9f2..7d74327c55 100644
--- a/bitbake/lib/prserv/db.py
+++ b/bitbake/lib/prserv/db.py
@@ -14,7 +14,7 @@ sqlversion = sqlite3.sqlite_version_info
14if sqlversion[0] < 3 or (sqlversion[0] == 3 and sqlversion[1] < 3): 14if sqlversion[0] < 3 or (sqlversion[0] == 3 and sqlversion[1] < 3):
15 raise Exception("sqlite3 version 3.3.0 or later is required.") 15 raise Exception("sqlite3 version 3.3.0 or later is required.")
16 16
17class PRTable(): 17class PRTable(object):
18 def __init__(self, conn, table, nohist): 18 def __init__(self, conn, table, nohist):
19 self.conn = conn 19 self.conn = conn
20 self.nohist = nohist 20 self.nohist = nohist
@@ -223,7 +223,7 @@ class PRData(object):
223 except OSError as e: 223 except OSError as e:
224 if e.errno != errno.EEXIST: 224 if e.errno != errno.EEXIST:
225 raise e 225 raise e
226 self.connection=sqlite3.connect(self.filename, isolation_level="DEFERRED") 226 self.connection=sqlite3.connect(self.filename, isolation_level="DEFERRED", check_same_thread = False)
227 self.connection.row_factory=sqlite3.Row 227 self.connection.row_factory=sqlite3.Row
228 self._tables={} 228 self._tables={}
229 229