Hello
I need to implement concurrency in an app that was written with 2.8.13. If
possible, I'd like to avoid upgrading to 3.x.
As an easy way to handle concurrency, someone mentionned the following
idea: In each table, add a column which will contain a monotonically
increasing counter so that it's possible to tell if a row was modified by
another user while the current user still had SELECTed data up on his
screen, ie. dirty read. Here's the algo:
1. SELECT data and save the timestamp in a variable:
dim orig_ts as integer, local_id as integer
query = select id,name,ts from mytable;
orig_ts = ts
local_id = id
2. make changes
3. Save changes:
update mytable set name='bart', ts=orig_ts + 1 where id=local_id and ts=orig_ts
=> If record wasn't changed in between select and now, OK
=> If record was changed by another user, error.
According to online documentation, there's an error message
"SQLITE_NOTFOUND (Internal Only) Table or record not found".
Is this error message
- available in 2.8.x?
- returned to user queries ("Internal Only")?
- triggered with the above UPDATE?
If not, is there a way to tell that the UPDATE failed because the record
has already been updated by someone else and not because of some other
cause? I need to know this so the front-end server can tell the client to
send a new SELECT to fetch the latest data, instead of just returning an
error with no information about why it failed.
Thanks.
-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------