vendredi 28 août 2015

Is there a propagation delay between SQLite connections for committed data?

We have a C++ application on OSX using SQLite 3.7.7.1 (old, I realize), and I'm seeing the following behavior:

  1. Thread 1 of app has connection to file1.db, creates a savepoint, inserts rows into table1, then releases savepoint.

  2. Thread 2 of same app has connection to file2.db, and has previously attached file1.db in the same connection. It now tries to insert into file2.table2 by selecting from file1.table1.

If 1 & 2 occur close together (within 1 second), we are seeing that the row inserted in step 1 is not inserted into table2. But if we wait 1 second between steps 1 & 2, we always see the row inserted. Step 2 is definitely occurring after Step 1 commits, as we are logging the statements and can observe it.

We are running in the default journal_mode (delete). I see that if you're running in WAL mode, changes are not committed until a checkpoint operation is performed.

Is there some kind of propagation delay between connections shared by the same application when in journal_mode=delete? The rules governing isolation levels (http://ift.tt/1PXIkO9) don't expressly forbid it.

Aucun commentaire:

Enregistrer un commentaire