SQLite: Disable mutex on connections
By default SQLite opens DB in Serialized mode, allowing connections to be used from several threads simultaneously: https://www.sqlite.org/threadsafe.html According to Qt documentation, database can only be used from one thread. This change opens sqlite dabases in "Multi-thread" mode, so that one does not pay for useless mutex locking for each DB access Change-Id: Ife61f1a648d74c91d3b27a2ce0059d052ccc62b2 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>bb10
parent
8092a01f84
commit
610a9e8f31
|
|
@ -700,6 +700,8 @@ bool QSQLiteDriver::open(const QString & db, const QString &, const QString &, c
|
|||
if (openUriOption)
|
||||
openMode |= SQLITE_OPEN_URI;
|
||||
|
||||
openMode |= SQLITE_OPEN_NOMUTEX;
|
||||
|
||||
if (sqlite3_open_v2(db.toUtf8().constData(), &d->access, openMode, NULL) == SQLITE_OK) {
|
||||
sqlite3_busy_timeout(d->access, timeOut);
|
||||
setOpen(true);
|
||||
|
|
|
|||
Loading…
Reference in New Issue