Re: SQLite + journal + lock
Hi, see my answer here. Looks like your problem as well.
Cheers,
-- Tanuki
Re: SQLite + journal + lock
Thank you, i've tried it, but it didn't solve the problem.
The filesize of the journal is, of the application is running 0 kb.
When I exit the application the file size of the journal file is >= 2kb and <= 23 kb.
The changes are also not made, after i restart the application :(
Best Regards
NoRulez
Re: SQLite + journal + lock
Ok, I think the problem has to do with the following message i noticed, when I exit the application:
[4580] QSqlDatabasePrivate::removeDatabase: connection 'qt_sql_default_connection' is still in use, all queries will cease to work.
How can i find out, on which point the database connection is still alive?
Best Regards
NoRulez
Re: SQLite + journal + lock
Nope. You see that message because database plugins in Qt implemented as static singletons. It is just warns you that it closes the db and will cease all current connections used by your app. But anyway, it is extremely strange if you cannot write anything in db because of locks. So if you will answer a couple of questions then maybe I could suggest you something.
1. Does your app the only one who use that db?
2. Which else apps are using it?
If your app is the only one, try to open just one connection with non-default name (see SessionName parameter in QSqlDatabase::addDatabase) and try to perform some stupid insert there. And don't forget to process the query errors. May be you have wrong syntax in query itself. Another possible issue is that if you use transactions - please be sure you either commit or rollback that before jumping to some other place of your app. So make it consistent like that:
Code:
// ... database verification code. I skip that but you can see the example in qt examples or my previous post.
// And query itself
bool batch = m_db.transaction ();
// ... Your batch queries
if (batch)
m_db.commit();
If you leave transaction block when you already started transaction and didn't finish it - yeah it will block. That's logical.
Best regards,
-- tanuki