WARNING: This server is unstable and will be retired in the next days. If you want to keep this forum available, please request immediately a migration on the Nabble Support forum. Forums that don't receive any migration request will be deleted forever.

 « Return to Thread: SQLite 3.7.11 behavioral change from 3.7.10 with concurrency -- bug??

SQLite 3.7.11 behavioral change from 3.7.10 with concurrency -- bug??

by Brad House-2 :: Rate this Message:

| View in Thread

We just noticed a behavioral change in SQLite 3.7.11 that caused a
regression in our software.  This change did not exist in 3.7.10.
Looking back at the changelog, I notice this:

"Pending statements no longer block ROLLBACK. Instead, the pending statement will return SQLITE_ABORT upon next access after the ROLLBACK."

But I do not know exactly what that means or why that change was
made.  I've got to assume this is not an intended behavioral change
as it is very significant at least from our standpoint as we've
been using the same logic since SQLite 3.3.

I've got 2 threads with different connections to the same database.

This is approximately what I am seeing:
   Thread 1:   SELECT bar,baz FROM foo WHERE ...;
   Thread 2:   BEGIN IMMEDIATE TRANSACTION;
               INSERT INTO foo VALUES (...);
                   **sqlite3_step returns 6 (SQLITE_LOCKED)
               ROLLBACK TRANSACTION
   Thread 1:   **sqlite3_step returns 4 (SQLITE_ABORT): abort due to ROLLBACK


So why, if Thread 2 rolls back does Thread 1 get aborted?  This is
where the 3.7.11 logic doesn't make sense, Thread 2 rolls back
specifically so Thread 1 can continue since it "got there first".

I can probably write up a test case if necessary, but wanted to
pass it by you all first.

Thanks!
-Brad
_______________________________________________
sqlite-users mailing list
sqlite-users@...
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

 « Return to Thread: SQLite 3.7.11 behavioral change from 3.7.10 with concurrency -- bug??