Change in qsql_sqlite.cpp
-
We developed an application with QT embedded version 5.9.
This application uses lot of Thread, and each Tread access Sqlite database in read write with no problem since 2017. And on a lot of platform.
Lately we had to use another version of QT for a new embedded platform.
Unfortunately, application start to crash.
After investigation we found that there has had a modification:
https://code.qt.io/cgit/qt/qtbase.git/commit/src/plugins/sqldrivers/sqlite/qsql_sqlite.cpp?id=610a9e8f319eafcbcf193e4b90119a6f89d0caf9
SQLite: Disable mutex on connections
This modification is still effective up to the latest QT version.
Why brick something that works well jusy because developer taught the documentation was incorrect.We fixed the problem for our purpose but think about all developer in the world that can't use Sqlite correctly because of this patch.
Please fix it for new QT release.
Regards,
-
@FRDU said in Change in qsql_sqlite.cpp:
Why brick something that works well jusy because developer taught the documentation was incorrect.
Because it was wrong in the Qt context - you have to open a QSqlDatabase connection in the thread where you want to use it, you must not share it over threads and therefore the mutex is not needed (and just wastes cpu cycles)
-
This requirement has been present in the docs since Qt 4:
Threads and the SQL Module