Marco Bambini <[EMAIL PROTECTED]> wrote:
> I have several threads inside an application and each thread opens a
> connection to the same database.
> The application has been compiled with SQLITE_THREADSAFE = 1.
> One of the threads (just one) open another database connection to the
> same database used by ALL threads for all the writing operations.
>
> So I have N threads and N+1 db connections ... and the one db
> connection is SHARED between all the threads just for WRITE operations
> (the others N are used just for READ operations on the db).
> I thought that this approach could prevent my app from receiving a
> SQLITE_LOCKED error... but sometimes it still occurs.

Do you, by any chance, enable shared cache mode, as in 
http://sqlite.org/sharedcache.html? I believe that's the only situation 
where SQLITE_LOCKED error is occured.

> Any idea of the reason of the error?

You have two connections, one of which is writing to a table and the 
other is reading the same table. I'm not sure why you believe your setup 
somehow prevents this.

Igor Tandetnik



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

Reply via email to