Process A updates data base table in the tight loop. Nothing special:

loop
 sql = "UPDATE table SET blob=:blob WHERE id=?"; 
 rc = sqlite3_prepare_v2(…)
 rc = sqlite3_bind_int(…)
 sqlite3_bind_blob(…)
 rc = sqlite3_step(…) 
 rc = sqlite3_reset(…) 
rc = sqlite3_finalize(…);

Process B just reads from
the same table. 
 
Loop
{
sql = "SELECT * from table";
sqlite3_prepare_v2(…);
loop with 
rc = sqlite3_step(…);
 
rc = sqlite3_finalize(…);
}
 
The problem which I encounter is as follows:
 
====== In process A ======
sqlite3_step() and sqlite3_reset(…) fail frequently with the error nr 5 = 
“database is locked”.

====== In process B ======
sqlite3_step(…) and sqlite3_finalize(…) fail with the same error “database is 
locked”.
 
 ==== I thought that I can have 1 writer and many readers ====
 
Unfortunately it appears that even 1 reader can interfere with the writer. And 
the reader fails too.
The OS is Win XP Pro.
 
What don’t I understand here?  
 
Thank you,
Samuel 


      __________________________________________________________________
Ask a question on any topic and get answers from real people. Go to Yahoo! 
Answers and share what you know at http://ca.answers.yahoo.com
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to