On 4/15/2014 8:47 AM, MikeD wrote:
If another thread deletes/updates or inserts while a SELECT statement is
processing the results could
be unpredictable?

Is that other thread using the same connection as the SELECT, or a different connection? If the latter (two separate connections), than the problem fails to arise: the other thread will be blocked / get an error (in rollback journal mode), or will safely write to the journal while the SELECT reads original data from the main database (in WAL mode).

If the two threads use the same connection, then yes, the results of SELECT are unpredictable if another thread (or the same thread, in between sqlite3_step calls) modifies the data being iterated over.

Would issuing a BEGIN IMMEDIATE before a SELECT statement solve this?

No it will not. Each statement initiates an implicit transaction anyway, if one was not created explicitly.
--
Igor Tandetnik

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to