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>
continue
raise exc
+ def sync(self):
+ self.conn.commit()
+ self._execute("BEGIN EXCLUSIVE TRANSACTION")
+
def _getValueHist(self, version, pkgarch, checksum):
data=self._execute("SELECT value FROM %s WHERE version=? AND pkgarch=? AND checksum=?;" % self.table,
(version, pkgarch, checksum))
except:
self.handle_error(request, client_address)
self.shutdown_request(request)
-
+ self.table.sync()
def process_request(self, request, client_address):
self.requestqueue.put((request, client_address))
while not self.quit:
self.handle_request()
+ self.table.sync()
logger.info("PRServer: stopping...")
self.server_close()
return