Hello,

When testing our app with the newest Qt, I bumped into the error in the
subject (and nothing works :)).

How are we supposed to use SQLite :memory: databases from multiple
threads where each QSqlDatabase::addDatabase() call creates a new, empty db?

SQLite driver embedded in QtSql is compiled with THREADSAFE=1 [1][2]. So
it's safe to use it from multiple threads. I'm sure not all SQL drivers
come with thread safety guarantees like this, but limiting the
functionality of the whole module just because one or two database
backends are not threadsafe is not the right move.

This should be a big fat warning in the documentation but enforcing it
like this is too harsh.

We are all C++ programmers so we are supposed to know what we are doing
(hahaha :))) It's not Qt's job to protect us from our own choices.

Please revert this change or at least make it driver-specific so those
of us who use SQLite from multiple threads are don't have to patch Qt.

Best regards,
Burak

[1]: https://sqlite.org/compile.html#threadsafe
[2]: You can check it by running PRAGMA compile_options

_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to