Mikey C uttered:


What are peoples thoughts on implementing optimistic concurrency control in
SQLite?


Not an option. SQLite has a single writer database locking protocol which can't handle multiple writers, so the issue of concurrency control is moot.



One way is modify the where clause to compare every column being updated,
old value to new value.  This makes the SQL cumbersome.

Microsoft SQL Server has a column data type named TIMESTAMP/ROWVERSION which
is database-wide unique number that gets updated every time a row gets
updated.  Effectively it is a hash of all the current values in every row of
the table and is updated automtically.

Hence to see if any row has been updated by another person you just have to
compare the  TIMESTAMP/ROWVERSION  value you read with the one currently in
the table in the UPDATE where clause.



Q. Does SQlite has such a capability?  Can we have one please? If not, is it
easy to simulate one?  If not, how do people manage concurrency in
applications such as web sites?


A. No. Probably not. Probably not. Use a client/server DB such as
   PostgreSQL which already has multiple version concurrency control.

Right tool for the job. If it's multiple concurrent writers, SQLite isn't it.


Christian



--
    /"\
    \ /    ASCII RIBBON CAMPAIGN - AGAINST HTML MAIL
     X                           - AGAINST MS ATTACHMENTS
    / \

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

Reply via email to