Details
-
Bug
-
Resolution: Invalid
-
Not Evaluated
-
None
-
5.2.0
-
None
-
Ubuntu 12.04.2 LTS
sqlite version 3.7.9 (commandline interface)
Description
It seems QSqlTableModel in some cases blocks SQLite databases, i.e., prevents write access by another process. When running the attached application, the database given in the header of the QMessageBox is locked after the QMessageBox shows up. To try it, open a terminal window and type
sqlite3 </path/to/database> "UPDATE main SET colorcode=1 WHERE id=5;"
If DBSIZE (#defined in the attached source code) is sufficiently high (266 in my case, but could be different on other machines or operating systems), then I get "Error: database is locked".
Once the QMessageBox has been closed, the database is open for write-access. And at that point, the database can be opened by several sqlite3 instances in parallel without blocking write-access. Thus, it is not a bug in sqlite but apparently a bug in Qt.