On Tue, Jun 25, 2013 at 6:44 PM, Eric Sink <[email protected]> wrote:

>
> From reading sqlite3.c and the comments therein, it would appear that
> BEGIN IMMEDIATE TRANSACTION never invokes the busy handler.
>
> Is that correct?
>

Correct.  BEGIN IMMEDIATE returns SQLITE_BUSY if it cannot proceed, and if
your application wants to delay and try again, it is free to do so.

The intent of the busy handler is to delay the progress of operations that
are difficult to restart, in the hopes that whatever is blocking progress
will clear.  There is no difficulty in restarting BEGIN IMMEDIATE so it
fails straight away.

Note also that once you get an IMMEDIATE transaction going (once BEGIN
IMMEDIATE returns SQLITE_OK) you are guaranteed to never hit the busy
handler nor get SQLITE_BUSY until after the transaction commits.


-- 
D. Richard Hipp
[email protected]
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to