SQLite Forum

SQLite DB corrupt while inserting the data in iOS application.
Login
Does your application close all SQLite connections before it quits ?  It could do this on quitting time or every time it's switched into the background.

How are you deleting existing data ?  Are you using <code>DELETE FROM</code> commands ?  Or are you deleting and copying the closed database file ?

As a temporary measure for diagnostic purposes, pease have your application run the command

<code>PRAGMA integrity_check</code>

and look at the results each time it's about to delete existing data and insert newly fetched data.  This should tell you with more precision when the database is getting corrupted.