So in other words a pseudo function like this:

BEGIN EXCLUSIVE
if anyerror return
INSERT INTO [table]
if anyerror ROLLBACK
INSERT INTO [table]
if anyerror ROLLBACK
UPDATE [table]
if anyerror ROLLBACK
UPDATE [table]
if anyerror ROLLBACK
COMMIT
if anyerror ROLLBACK
return

Would that guarantee ROLLBACK on any error?
Does last ROLLBACK knows it should rollback from BEGIN EXCLUSIVE or should I
still mark it with SAVEPOINT?

The following was what I did with my tests
1. if i did say 10 "INSERT INTO" - and it failed at #7 - first 6 were kept,
7 was deleted
2. if i did the same but with INSERT OR ROLLBACK INTO... the same as 1.
3. if I enclose all INSERT INTO in BEGIN/COMMIT block - then it rolled back
entire block (all 10) and I didn't had to call ROLLBACK (it was automatic).
The error was one of the "severe" ones - DISK_IO error (low disk space).

I also tried sqlite3_get_autocommit which is true for 1 and 2 and false
after BEGIN (as it should be).
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to