Hello all,
 
We've been using SQLite for our database needs in our new program
version, and unfortunately, we've run into some corruption issues.  We
believe that the corruption has been caused by deleting journal files.
 
The program is a music manager and when managing a portable device, we
copy the database locally before opening it.  If the program crashed in
the middle of a transaction, a journal file would be left there.
Therefore, the next time the database was opened, it did not match the
journal file, and would cause "strange stuff" to happen.   We detected
the problems this caused, and our fix was to always delete the journal
file before opening with sqlite_open().  After some more research, we
discovered that always deleting the journal wasn't quite right.  We now
only delete the journal file when we know that the database and journal
don't match.
 
So are there any other cases when we should delete the journal file when
opening a database?  Can always we leave the journal alone if we open
the database while a transaction is active?
 
We are using SQLite 2.8.16.
 
Thanks,
Aaron

Reply via email to