Thanks, Simon.

Simon Slavin-3 wrote
> Your solution seems to do it by exchanging data accessed using the SQLite
> API so you shouldn't have that sort of problem.

Yes, only standard SQLite API is used.


> I assume that you aren't using any PRAGMAs which speed up SQLite at the
> expense of safety, for instance, keeping journals in memory or turning off
> synchrony..

No tricks are done. My first post contains all SQLite settings used.


> ...If the database is corrupted because your hardware flipped bits during
> power-loss and overwrote the wrong part of the disk, the corruption might
> well be in a different table...

Clear. I just wonder that integrity_check first performs a number of checks
that validate that all tables are basically ok. As part of this process also
the indexes are formally declared as correct tables. Only then, when the
contents of the indexes is checked (thing that cannot be done for ordinary
tables), some problems are found.

I would expect a different report if some random bits are overwritten.

Moreover, the error report suggests the hypothesis as if the the data
transaction was correctly completed on all data tables, but the indexes were
for some reason not updated.

I am just looking for a feasible explanation, I don't know how SQLite works
internally.


> I am slightly concerned about your mention of "App is killed".  Is this
> part of your routine operations or are you just being careful to mention
> that it's possible ?

Killing can be done only by iOS.

Suppose our app is running and the user switches to email reading. The app
continues running on background and roughly after 10 min the system sends a
notification that it is going to be frozen.

In reaction our app tries to interrupt the data communication with the
server (Problem1 - this may fail), closes the database (Problem2 - possible
NullReferenceException some time later) etc. Then iOS freezes the
application.

What happens then, depends on user activities. If he opens say huge PDF, iOS
may decide to kill the app. If not, the app will be resumed after some time.

Many things can happen in this process (lousy programming, I have to improve
lots of things...).  The worst scenario is that the app is killed by OS
during some SQLite action.

------

I apologize in advance: I'll be out of office until next Tuesday.





--
View this message in context: 
http://sqlite.1065341.n5.nabble.com/Integrity-check-tp77519p77575.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