tags:

views:

33

answers:

0

This is an issue that has been plaguing me for a while now. I am trying to use SQLite DBs to store information in my application. Once I open a DB, I close it right after I'm finished. Here is a rough overview of what I do:

getWriteableDB;
// Perform DB Operations
closeDB;

This works great, most of the time. Occasionally, the DB files become corrupt and it has to delete them and create a new one. On top of that, sometimes it fails when creating a new DB with a "Failed to setLocale() when constructing, closing the database".

I'm really stumped by all of this as I thought SQLite was supposed to be pretty dependable. It's been more trouble than it's worth in my experience, but perhaps I am doing something wrong.

Also, when my application has multiple tables, I've begun to put only one table in each DB so that if one table operation messes up, it only corrupts that table's information and not any other tables information.

Thanks,

groomsy