On 2/10/2012 12:29 PM, Sreekumar TP wrote:
Can this situation be handled in sqlite - by upgrading the lock to a
writer lock ? Since both applications use the same WAL file for read and
writes, it shouldnt be a problem , because all changes will be in linear
sequence ?
Consider again:
[1] BEGIN;
[1] SELECT balance from Accounts; (1)
[2] BEGIN;
[2] SELECT balance from Accounts; (2)
[2] UPDATE Accounts SET balance = balance + 100;
[2] SELECT balance from Accounts; (3)
[2] COMMIT;
[1] UPDATE Accounts SET balance = balance + 100;
[1] SELECT balance from Accounts; (4)
[1] COMMIT;
[3] SELECT balance from Accounts; (5)
Statements are shown in the order they are submitted to SQLite. Numbers
in square brackets indicate individual connections.
Let's suppose SQLite does everything the way you want (it's not quite
clear what it is you want exactly, so that's what I'm trying to
establish). I assume you expect this sequence of statements to succeed.
In this ideal world, what value of Accounts.balance should be observed
at points (1), (2), (3), (4) and (5), in your opinion?
--
Igor Tandetnik
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users