On 14 Oct 2013, at 5:32pm, Jared Albers <jaredaalb...@gmail.com> wrote:
> Do SELECT statements automatically start a transaction in order to > obtain the SHARED lock? In other words, is the SHARED lock started as > a result of the SELECT statement or as a result of the transaction? I > was reading the "SQL as Understood by SQLite" documentation and it > says the following: > > "No changes can be made to the database except within a transaction. > Any command that changes the database (basically, any SQL command > other than SELECT) will automatically start a transaction if one is > not already in effect." > > Does this excerpt from the documentation mean to say that SELECT > statements don't use transactions in addition to a SELECT statement > not modifying the database? That "other than" is, I think, incorrect. Even a SELECT statement automatically gets wrapped in a transaction if you haven't declared one for it. And that transaction can lock the database. This is what stops a write from another process messing up a SELECT that needs to create its own index. Simon. _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users