Closing the thread:
>Then why sqlite3_step() fails for the reader and for the 
writer?


The reader fails since
it cannot obtain SHARED lock required for reading.
It cannot obtain that
lock since the writer already managed to obtain PENDING or EXCLUSIVE lock.
 
The writer fails since
there is pending SHARED lock acquired by reader which did not finished reading.
The writer needs to obtain EXCLUSIVE lock and no other
locks of any kind are allowed to coexist with an EXCLUSIVE lock.


----- Original Message ----
From: Igor Tandetnik <itandet...@mvps.org>
To: sqlite-users@sqlite.org
Sent: Sun, February 14, 2010 2:54:35 PM
Subject: Re: [sqlite] 1 reader 1 writer but sqlite3_step fails with “database 
is locked”  error in both processes

a1rex wrote:
> ==== I thought that I can have 1 writer and many readers ====

You thought incorrectly. You can have one writer OR many readers.

Igor Tandetnik


      __________________________________________________________________
Make your browsing faster, safer, and easier with the new Internet Explorer® 8. 
Optimized for Yahoo! Get it Now for Free! at 
http://downloads.yahoo.com/ca/internetexplorer/
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to