On Thu, Sep 19, 2013 at 4:35 PM, Richard Hipp <d...@sqlite.org> wrote:
> On Thu, Sep 19, 2013 at 5:50 PM, Igor Korot <ikoro...@gmail.com> wrote: > > > > > Now, AFAIU, I need to check if the COMMIT is successful. > > But what should I do if it fails? Do I just report the failure to the > user? > > Do I need to call ROLLBACK? And what if it will also fail? > > And in "else" branch - do I check for "ROLLBACK" result? And if it fails > > what do I do? > > > > You probably should report the COMMIT failure to the user, yes. > > Beyond that, what you do depends on what you want to do next. You can just > call exit(1) if that is appropriate. Or you can ROLLBACK and keep using > the connection. Or you can sqlite3_close() the database connection if you > want. > OK, so if I don't call ROLLBACK what will happen? Will I end up with the screw-up database file? Problem is that if the COMMIT fails, ROLLBACK might fail as well. That's why I ask if I have to call ROLLBACK or just continue working. Thank you. > > Depending on the reason for the COMMIT failure, you might be able to try it > again, after a delay. > > -- > D. Richard Hipp > d...@sqlite.org > _______________________________________________ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users