I actually have a question regarding nested transactions. Maybe I'm missing
something, but isn't it true that the outermost transaction must be
committed successfully in order for any of the nested transactions to also
be committed successfully?

For example if I have:

BEGIN TRANSACTION a;

BEGIN TRANSACTION b;

[some sql code]

COMMIT;

[some sql code that errors out]

ROLLBACK;


Wouldn't that mean that, even though transaction "b" was successful, since
the whole thing was embedded into transaction "a" it would fail anyway?

So, couldn't SQLite simply internally keep track of nested transaction
through a counter that is incremented every time "BEGIN TRANSACTION" is
encountered and decremented whenever "COMMIT" is encountered, and only truly
COMMIT when that counter has reached 0 again?

(That's what I implemented for an in-house abstraction layer.)

Just wondering if I'm missing something critical.


Thanks.



-----Original Message-----
From: Marco Bambini [mailto:[EMAIL PROTECTED] 
Sent: Thursday, November 03, 2005 12:23 PM
To: sqlite-users@sqlite.org
Subject: [sqlite] BEGIN TRANSACTION name

In actual version, the optional transaction name is ignored because  
SQLite currently does not allow nested transactions.

Any plan to change this behavior in the near future?

Thanks,

Marco Bambini

Reply via email to