Hello,

I use SQLITE with Xojo (formerly Realbasic), a kind of VB multiplatform. 
Xojo embeds a SQLITE 3.9.2 database.
It works well. But I have a concern, and I do not know if it is a Xojo 
problem, or a SQLITE problem.

I am creating an application with Xojo/Sqlite.

This application launches multiple threads (*cooperative threads*, 
non-preemptive, therefore all threads belong to a single process).
Each of these threads opens a connection to the SQLITE database (WAL mode).

If multiple threads try to read simultaneously in the database, no 
problem, it works well.

If multiple threads read and only one thread writes, no problem, it 
works well (WAL mode).

But I have a problem in this case:

- One thread writes
- While this thread wrote, another thread requests to write. Of course, 
a "busy" error is generated, this is normal. But until the error is 
generated, all threads in the application are frozen during the sqlite 
timeout!

I tried using "sqlite3_progress_handler" with multiple values. But it 
doesn't change anything. I also tried using the Xojo features which 
allow to leave time to other threads, but same problem.
If Sqlite is busy, all threads in the application will be blocked for 
the duration of the timeout.
What do you think?

Thank you
olivier

Reply via email to