Closed fxdeniz closed 1 year ago
in 50d60deed62761f196e6317310ec33a934e6d064 I added a workaround. By adding
database.close();
database.open();
beginning, I'm probably preventing cyclic lock.
When close()
is called on QSqlDatabase
, it destroys all of it's children QSqlQuery
objects. Because all QSqlQuery
objects are destroyed, lock is released on table Folder
.
Finding better lock releasing mechanism or re-designing FileSystemEventDb::addFolder()
and FileSystemEventDb::addFile()
will solve the issue completely.
50d60deed62761f196e6317310ec33a934e6d064 currently works perfectly but beginning of the code looks weird.
FileSystemEventDb::addFolder()
locks tableFolder
and causes other instances ofFileSystemEventDb
get stuck. I only observed this behavior on Windows, in Linux everything works as expected.This is probably related with transaction in
FileSystemEventDb::addFolder()
. Somehow, transaction management inFileSystemEventDb::addFolder()
trigers this problem, and callingFileSystemEventDb::addFolder()
inFileSystemEventDb::addFile()
further complicates things.I observed these, when
FileSystemEventDb::addFolder()
locks the database:gui in
File Monitor
shown empty, becauseTreeModelFsMonitor
can't read database fromFileSystemEventDb::getActiveRootFolderList()
Query buttons in
DialogDebugFileMonitor
crashes entire program when clicked. That is,SqlQueryModel
objects can't read the database which leads to timed out read requests. Eventually, program accesses null pointers ofSqlQueryModel
objects.