Dennis Cote <[EMAIL PROTECTED]> wrote:
Darren Duncan wrote:

I will clarify that child transactions are just an elegant way of
partitioning a larger task, and that parent transactions always
overrule children; even if a child transaction commits successfully,
a rollback of its parent means there are no lasting changes.

Because of this, and the fact that a transaction is basically a
guarantee that all or none of the enclosed statements are executed, it
is much simpler to implement nested transactions using a counter and
the existing transaction API in a set of wrapper functions. There is no
need to maintain all the intermediate state information.

Support for nested transactions should allow one to roll back the child transaction to the point where it has started, but still commit the overall transaction. Consider:

BEGIN parent;
insert into t values ('a');
BEGIN child;
insert into t values ('b');
ROLLBACK child;
insert into t values ('c');
COMMIT parent;

As a result of this sequence, the table should have two new rows with values 'a' and 'c', but not 'b'. As far as I can tell, this is impossible to implement in terms of existing SQLite API.

Igor Tandetnik

-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to