SQLite Forum

Unexepected commit result with two threads application
I will try to find something additional, but at the current moment I made a following test with logging
  if (p->rc != SQLITE_OK)
    sqlite3_log(..., "dif code: %u", p->rc);
  p->iCurrentTime = 0;
  assert( p->explain==0 );
  p->pResultSet = 0;
  db->busyHandler.nBusy = 0;
  if( AtomicLoad(&db->u1.isInterrupted) ) {
    sqlite3_log(..., "to interrupt: %u", p->rc);
    goto abort_due_to_interrupt;

and the first log call (dif code) is triggered in the Thread1 (MainUI, on Commit sqlite3_step, I see this at the stack trace) with p->rc:SQLITE_BUSY and the second one (to interrupt) never called. So it's probably somewhere in the following code when the p->rc values difference might matter