https://www.sqlite.org/howtocorrupt.html

I know you said you already checked this, so just ignore the following
remark:

iOS is one of the easiest platforms to accidentally end up with "Multiple
copies of SQLite linked into the same application".

Just sayin'.

--
E


On Thu, Aug 13, 2015 at 2:04 PM, Simon Slavin <slavins at bigfraud.org> wrote:

>
> On 13 Aug 2015, at 6:32pm, skywind mailing lists <mailinglists at skywind.eu>
> wrote:
>
> > Before my app closes I close the database explicitly. Though I do not
> know if this happens always when the iDevice shuts down due to battery
> issues.
>
> iDevices shut down quite a time before they'd actually run out of power.
> Before your device shuts down your App will get notified that it's going to
> background, and then get notified that it's going to quit.  If you're
> handling those two notifications properly (i.e. closing all SQLite
> connections at one or the other) then you should not be getting database
> corruption.
>
> Things to check are running your App inside some sort of memory logger,
> e.g. valgrind .  I don't know if this is possible on the Xcode simulator, I
> think it's built in as a 'Tool'.  And also to check the values returned
> from /all/ your SQLite calls, even ones like _close() where if they fail
> there's nothing you can do about it.  If one of them is not SQLITE_OK then
> you should show an error message.  The call which corrupts the database is
> sometimes an apparently harmless call.
>
> Simon.
> _______________________________________________
> sqlite-users mailing list
> sqlite-users at mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>

Reply via email to