On Mar 3, 2019, at 8:32 AM, Simon Slavin <slav...@bigfraud.org> wrote:
> 
> To summarize, the list feels that this is an incorrect model
> 
>    BEGIN;
>    ... first set of commands
>    ROLLBACK;
>    ... second set of commands
>    END;
> 
> whereas this is how things are meant to work:
> 
>    BEGIN;
>    ... first set of commands
>    ROLLBACK;
>    BEGIN;
>    ... second set of commands
>    END;
> 
> and that since ROLLBACK ends a transaction, it releases locks.  The above is 
> correct for all journalling models except for OFF, where the effect of 
> ROLLBACK is undefined.  (I'm ignoring SAVEPOINTs for now.)
> 
> Simon.
> 

And the way to get the first pattern is to set a SAVEPOINT right after the 
BEGIN and restore back to it instead of using ROLLBACK.
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to