Thanks, Pavel, for answering my questions!

>> I am also thinking that I may want to make use of the sqlite_unlock_notify() 
>> call to ensure that if I try to write to the database and it fails to get a 
>> lock, it will pend until it is available.  However, I thought that a query 
>> would pend until it gets a lock anyway.  Is that not the case?

>sqlite3_unlock_notify() works only with shared-cache mode within one
>process. It doesn't work in inter-process locking. And by default
>query won't be pending until locking is possible. If you use function
>sqlite3_busy_timeout() you can obtain behavior close to what you want.

So, then what is the best way to make a query from one process pend until the 
database is available?

For example, let's say I have two processes that connect to the same database 
file.  One process wants to read from the database, but the other process is in 
the middle of a write.  Does the first process pend on the read or not?  If it 
does not, what does it return?  Is it a successful read?  What about the 
reverse case when the first process wants to write but the second process is 
reading?  Is this what I would use sqlite3_busy_timeout() for?

Thanks for the help!

Jonathan

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

Reply via email to