I'm using SQLite3 for an embedded project. I have to concurrent processes that access a sqlite database.
First process will do insert in the db (approx 50 per second). And the second process will try to drop from the db (approx 100 per second).
Basically, my first process will collect data from a network, and will store it in the database. The second one will pop from the database to send the data using GPRS connection.
The reason why I try to pop 100 elements per second (whereas I only store 50 elements per second) is to catch up, in case of GPRS connectivity is lost.
At a random moment, I get my database malformed :
sqlite> pragma integrity_check;
Error: database disk image is malformed
And my second process loops with this message :
Failed to get table: database disk image is malformed
Is there any way to programmatically cleanup the database in case it malformed ? My programs are written in C.
Thanks for any help