If your database storage device cannot guarantee an exclusive file 
lock, then any database write can potentially result in corruption.

If you control all SQLite clients' code, you could recompile sqlite
to use the file-based dotlockLockingStyle convention via 

  -DSQLITE_ENABLE_LOCKING_STYLE=1

But even if a single client does not use that locking convention, 
you still risk corruption.

--- Jeff Godfrey <[EMAIL PROTECTED]> wrote:
> I currently have a single-user SQLite-based application that, due to 
> customer need, is being pushed toward multi-user access.  I've done some 
> research on the multi-user capabilities of SQLite.  It seems the general 
> consensus is that when the database file is stored on a network drive 
> (as is my case), the integrity of the stored data becomes questionable 
> (apparently due to bugs in the various NFS file locking protocols). 
> 
> Fortunately, my application is designed such that (generally speaking) 
> each User of the system will be working within their own SQLite 
> database.  However, there are a few select places in the code where a 
> User could trigger an action that would cause the storage of data to a 
> common, upper-level SQLite database.
> 
> I think I can change portions of the application to ensure that these 
> common writes never happen concurrently, but I'd like to understand the 
> underlying situations and dangers that can occur in this environment.  
> So, what are the cases that could cause database corruption?
> 
> 1. Multiple Users writing to the same table of the same open database at 
> the same time?
> 2. Multiple Users writing to two different tables of the same open 
> database at the same time?
> 3. Multiple Users writing to the same table of the same open database at 
> different times?
> 4. Other cases I haven't thought about?
> 
> I realize there also some dangers with regard to potentially writing 
> "stale" data to the database thus losing someone else's updates.  I 
> still have some thinking to do in that regard, but for now I'd like to 
> understand the situations that could compromise the integrity of the 
> underlying database file itself.



       
____________________________________________________________________________________
Building a website is a piece of cake. Yahoo! Small Business gives you all the 
tools to get online.
http://smallbusiness.yahoo.com/webhosting 

-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to