On 12 Jan 2016, at 2:52pm, Adam Devita <adevita at verifeye.com> wrote:
> Under normal operation all access is controlled by 1 program that > serializes requests from the rest of the system, and executes batches > of statements in a transaction. Under normal operation only SELECT and > UPDATE queries are run. Does your program examine the codes returned by SQLite3 calls and check to see that they are all returning SQLITE_OK ? > The db doesn't grow in number of records. There are (always at this > firmware version) 1455 rows in a good db. > > Under upgrade, the above db management program is shut down and the > upgrade script runs commands through a shell tool. Does the script shut down the program and wait for the program to quit before it starts running its own commands, or are the two things done independently ? Are both programs running on the computer with the database stored on a hard disk, or is anything accessing the database across a network ? > Under upgrade we do > use INSERT OR REPLACE as well as update. Upgrades are normally > executed by creating a new db with default values (and inserting the > list of known ids) and then attaching the new db to the old one and > replacing records into the new db that have non-default values. Does /this/ program examine the values returned by SQLite calls to see that they're all SQLITE_OK ? Just as a closing comment, I note that almost all the cases of genuine database corruption I've seen are caused by faulty hardware. You've obviously read the "How to corrupt" document and that's what's left: hardware. Simon.