>Hi,
>    I am using sqlite 2.8.5 and I'd like to know if I can have  a proces 
>that reads(select) while a proces is writing (insert or update) in the 
>same db.
>
>I have read FAQ number 7  but it doesn't help me.
>Thank you very much.
>
>Bye Max

>FAQ 7
>**Can multiple applications or multiple instances of the same 
>application access a single database file at the same time?*
>
>    Multiple processes can have the same database open at the same time.
>    Multiple processes can be doing a SELECT at the same time. But only
>    one process can be making changes to the database at once.

The wording on FAQ 7 is very confusing.  I ran into this problem recently with sqlite. 
 The way it is used in our tool is that we allow many reads into the database, but we 
synchronize the writing so that only 1 thread in 1 process was writing to the DB.  
From reading the FAQ, it seems like this should NOT be a problem.  The FAQ seems to 
indicate that you can have X reads and 1 write SIMULTANEOUSLY happening.  This is 
obviously not the case as only the read or the write will get the lock and the other 
will get a busy.  You can handle this by setting a large timeout on the read.  I 
actually chose another route for my solution.  I recompiled the code to block when 
acquiring the read lock.  Both ways worked fine.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to