On Nov 12, 2007 2:43 PM, Yves Goergen <nospam.list@stripped> wrote:
> SELECT COUNT(*) FROM table WHERE name = ?
> -- a short delay which is long enough for a concurrent request :(
> UPDATE table SET name = ? WHERE id = ?
I think that even with SERIALIZABLE isolation level, this won't lock
anything if it doesn't match any rows, so someone could do an insert
between those statements. I could be wrong about that.
The alternative is to lock the table. I'm not sure how that would be
done in SQLite, although SQLite works by taking an exclusive write
lock on the entire database so it may not be an issue.
- Perrin