Thanks all for the answers. > Do you have a separate database handle (provided by a unique call to > sqlite3_open()) for each and every thread?
Yes, that's what I do, each thread creates a new DB connection on its start and uses only this connection then. > One means of troubleshooting this is to emit a log statement that > includes the thread id with every BEGIN/COMMIT (e.g. printf("%d - %s", > thread, sql)). It may be useful to log other sql statements this way as > well. Actually yes, that's what I do, using OutputDebugString in from WinAPI all SQL commands get to a log. > If you have additional evidence of problems in SQLite, I will be > glad to listen to it. Well, I think it's in SQLite (based on my code and the fact that some other users have the same problem with multiple threads). I understand it's hard to prove this, seems that I'll have to make a very simple sample application that exhibits the problem. Regards, Jiri