> "Sync action"?  What's that?

Local database is synchronized with remote DB. Synchronization goes table by
table (all table operations are grouped into a transaction) in several
iterations. The algorithm is very complex, but in the final step all DB
operations are linearized and executed on a single sync thread.

UI thread is used for normal user activities, which in terms of DB access
means classic select/insert/update/delete operations.

There is a single global instance of the DB connection. (Handle to sqlite DB
created by sqlite3_open_v2().) This handle can be created by either UI
thread or sync thread, whichever is executed first. Under normal workflow
this handle is used until the app terminates. (The only exception is the
delete of the whole database.)

Synchronization blocks UI thread by displaying top-level modal form, i.e. no
simultaneous DB access takes place. (Background sync is also possible, but
it wasn't used in the described case.) 

We'll analyze the sync process again, but would like to extract as much info
as possible from the observed crash. Hence again:

- DB index was corrupted. It contains a reference to the records that were
first added to the database (done inside a transaction), but shortly after
deleted.

- Most probably the DB connection was created by the sync thread. (Judging
by the tester description.) The crash happened immediately after the UI
thread enumerated account table.

- With a high probability this problem happens on iOS only. (We use "PRAGMA
fullfsync=1" on iOS.)

More details:
WAL mode
sqlite 3.7.15.2
sqlite C# interface based on system.data.sqlite package
custom NOCASE collation, custom encryption
The application serves as mobile CRM client.



--
View this message in context: 
http://sqlite.1065341.n5.nabble.com/What-can-be-deduced-from-integrity-check-tp70451p70472.html
Sent from the SQLite mailing list archive at Nabble.com.
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to