Re: [sqlite] COMMIT or ROLLBACK failure

2013-09-20 Thread Clemens Ladisch
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

Re: [sqlite] COMMIT or ROLLBACK failure

2013-09-19 Thread Keith Medcalf
> On Thu, Sep 19, 2013 at 4:35 PM, Richard Hipp wrote: > > On Thu, Sep 19, 2013 at 5:50 PM, Igor Korot > 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 > > >

Re: [sqlite] COMMIT or ROLLBACK failure

2013-09-19 Thread Igor Korot
On Thu, Sep 19, 2013 at 4:35 PM, Richard Hipp wrote: > On Thu, Sep 19, 2013 at 5:50 PM, Igor Korot 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? > >

Re: [sqlite] COMMIT or ROLLBACK failure

2013-09-19 Thread Richard Hipp
On Thu, Sep 19, 2013 at 5:50 PM, Igor Korot 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 -

[sqlite] COMMIT or ROLLBACK failure

2013-09-19 Thread Igor Korot
Hi, ALL, Consider following piece of code: int res = sqlite3_exec(..., "BEGIN"... ); if( res != SQLITE_OK ) { printf( "Error occured on begin transaction. Please try again." ); return; } // some operations on the database // if operations are successful sqlite3_exec( ...,