On 5/27/16, Paul Medynski <p...@medynski.ca> wrote:
>
> begin transaction;
>   ... Work A ...
>   savepoint Foo;
>     ... Work B ...
>     savepoint Foo;                <--- Allowed by #1
>       ... Work C ...
>     rollback to savepoint Foo;    <--- Rolls back Work C, but leaves the
>                                        innermost savepoint Foo active due
>                                        to #2
>
>     rollback to savepoint Foo;    <--- Does nothing - I can no longer
>                                        rollback past the innermost Foo
>                                        without rolling back the entire
>                                        transaction.

Foo is still on the stack twice.  If you want to go back to the first
one, you have to "RELEASE" the second one:

    RELEASE foo;  -- equivalent to "ROLLBACK foo" since there have
been no changes
    ROLLBACK TO foo;

-- 
D. Richard Hipp
d...@sqlite.org
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to