Igor Korot wrote:
> I need to check if the COMMIT is successful.
> But what should I do if it fails?

If the database is currently locked, you should try again later.  (But
this would be better handled with a busy handler.)

If there is some I/O error that prevents you from writing, the COMMIT
fails, but the ROLLBACK might still succeed (if nothing was written
yet).

If there is some permanent I/O error that prevents you from accessing
the files at all, both the COMMIT and the ROLLBACK will fail.

If there are pending write operations (which would be a programming
error), the COMMIT fails.  (The ROLLBACK will fail if there are any
pending queries.)  The correct way to handle this error is to fix the
bug in your program.


Read <http://www.sqlite.org/lang_transaction.html>, especially the
section at the bottom.


To summarize: if the COMMIT fails, try a ROLLBACK.  This might fail too,
but there's nothing you can do then.


Regards,
Clemens
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to