Details
-
Bug
-
Resolution: Invalid
-
P1: Critical
-
None
-
6.5.2
-
None
Description
I have an in-memory sqlite database which is accessed from several threads.
Each thread has its own database connection and the database is initialized with db.setDatabaseName("file:base?mode=memory");
db.setConnectOptions("QSQLITE_OPEN_URI;QSQLITE_ENABLE_SHARED_CACHE;QSQLITE_BUSY_TIMEOUT=10000000");
In addition I set the locking_mode to NORMAL.
According to all documentation I found these settings should enable the threads to access the database (nearly) without any driver errors.
But it appears that QSqlQuery sets a lock to the database whichremains until the query is cleared or deleted. This should not happen.
To reproduce this problem I've attached a little program which creates a table "woeld" with one entry. This entry is copied to a second one in a thread.
To show the effect I send the main thread to sleep for some time and then call query.cler(). In the thread I try the copy operation until it works.