summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/prserv/db.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2013-09-08 09:45:54 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-09-08 10:51:56 +0100
commit2ab1bf27f79beadc45e86a26c85fc0b95ae3496f (patch)
treebddf3a9ecd185960cdeadad07dcda5f96e3a724e /bitbake/lib/prserv/db.py
parent31709ed0afe6e5254eabf7036fcf0f2228802dbb (diff)
downloadpoky-2ab1bf27f79beadc45e86a26c85fc0b95ae3496f.tar.gz
bitbake: prserv: Ensure data is committed
In exclusive mode, we need to complete the transaction for writes to make it to the database. Therefore add sync calls to ensure this happens. Autocommit mode is significantly (100 times) slower so caching the data is of significant benefit. (Bitbake rev: 4e55f7821786a59c2cd7dbd8bfa2a22f5f196e99) 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, 4 insertions, 0 deletions
diff --git a/bitbake/lib/prserv/db.py b/bitbake/lib/prserv/db.py
index 559935544a..86eafe338c 100644
--- a/bitbake/lib/prserv/db.py
+++ b/bitbake/lib/prserv/db.py
@@ -43,6 +43,10 @@ class PRTable(object):
43 continue 43 continue
44 raise exc 44 raise exc
45 45
46 def sync(self):
47 self.conn.commit()
48 self._execute("BEGIN EXCLUSIVE TRANSACTION")
49
46 def _getValueHist(self, version, pkgarch, checksum): 50 def _getValueHist(self, version, pkgarch, checksum):
47 data=self._execute("SELECT value FROM %s WHERE version=? AND pkgarch=? AND checksum=?;" % self.table, 51 data=self._execute("SELECT value FROM %s WHERE version=? AND pkgarch=? AND checksum=?;" % self.table,
48 (version, pkgarch, checksum)) 52 (version, pkgarch, checksum))