So how do you propose to have consistency and isolation if SELECT does not 
create an automatic transaction if no explicit transaction exists?

Consider:

SELECT <some stuff> FROM <somewhere>;
BEGIN;
UPDATE <somewhere else> SET field = <some stuff> +1;
COMMIT;

If the SELECT and UPDATE statements are not part of the same transaction, there 
is no guarantee that <some stuff> is still valid by the time you use it in the 
UPDATE.

Or even better:

SELECT <value1> FROM <somewhere>;
SELECT <value2> FROM <wherever>;

How do you know that the expression <value1> + <value2> ever had that specific 
value (either one, or both, could have been changed between the two read 
operations)?

-----Ursprüngliche Nachricht-----
Von: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] Im 
Auftrag von Kira Backes
Gesendet: Montag, 12. August 2019 11:01
An: SQLite mailing list <sqlite-users@mailinglists.sqlite.org>
Betreff: Re: [sqlite] [EXTERNAL] SQLITE_BUSY (SQLITE_BUSY_SNAPSHOT) due to a 
simple SELECT query -- Documentation needed!

PS:

> Another example: X starts a read transaction using BEGIN and SELECT, then Y 
> makes a changes to the database using UPDATE.


Same goes for this example! We did not start a read transaction with BEGIN. 
This part says that you need to start a read transaction with BEGIN, which we 
did not do, and the other part says that SELECTs do
*NOT* start an automatic transaction.

So is this maybe even a bug in sqlite? Or the documentation is incorrect?

kind regards,
Kira Backes
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


___________________________________________
 Gunter Hick | Software Engineer | Scientific Games International GmbH | 
Klitschgasse 2-4, A-1130 Vienna | FN 157284 a, HG Wien, DVR: 0430013 | (O) +43 
1 80100 - 0

May be privileged. May be confidential. Please delete if not the addressee.
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to