On 12 Feb 2014, at 4:44pm, Sandu Buraga <sandu.bur...@gmail.com> wrote:

> I have a process with several threads working in the same time on a
> database file. I have 0 or 1 writers and 0 or N readers at a moment. All
> write accesses are isolated in transactions, I am using WAL and shared
> cache, but sometimes during the DELETE statemens I get "database table is
> locked" errors, either in the write or read thread.

Have you set a timeout value for all your connections ?  If you haven't, SQLite 
never does any waiting for locks at all, it just returns an error.  Use either 
of these:

<http://www.sqlite.org/c3ref/busy_timeout.html>

<http://www.sqlite.org/pragma.html#pragma_busy_timeout>

A reasonable number of milliseconds is however long you would want your program 
to wait before giving up and reporting an error to the user.  Values like 60000 
are not out of place.

Simon,


_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to