On 12/7/2013 12:15, James K. Lowden wrote:
On Wed, 04 Dec 2013 12:04:07 -0700
Warren Young <war...@etr-usa.com> wrote:
Determinism is a property of a function; there is no such
thing as a function that is sometimes deterministic and sometimes
not.
databases are about as far from side-effect-free as you can get.
I'm not sure what you're referring to.
I think your sense of the term "side effect" comes from the everyday
use, which is most influenced by medical side effects. i.e., something
bad and unintended.
The term means something rather different in CS:
https://en.wikipedia.org/wiki/Side_effect_%28computer_science%29
Specifically here, I mean that most SQL statements other than SELECT
modify global state: the SQLite DB file. Any statement that modifies
the DB file has the potential to change the result from *any* SQL
statement, including SELECT.
Example:
SELECT * FROM foo WHERE id=42;
UPDATE foo SET bar='qux' where id=42;
SELECT * FROM foo WHERE id=42;
The first and third statements return different results, even though
they are side effect free, because UPDATE is not side effect free.
Consider also that the UPDATE could come from another process, at an
indeterminate time. This is why concerns over side effects -- in the CS
sense -- matter.
SQLite offers many ways to *control* this indeterminacy, features
generally grouped under the acronym ACID, but you can't say "DBMS X is
ACID compliant therefore it will never surprise me with unexpected results."
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users