At 00:54 17/11/2005, Preston Z wrote:
If the power never goes out and no programs ever crash on you system then
Synchronous = OFF is for you, but the rest of the world might still want
it ON. Really it sounds like the thing you need to worry about most is the
unexpected termination of your program. If you aren't worried about that...
I'm pretty sure that even with Synchronous=off, a program crash won't cause
a problem. It's "only" OS crashes or power failures that are a problem.
From the docs:
"With synchronous OFF (0), SQLite continues without pausing as soon as it
has handed data off to the operating system. If the application running
SQLite crashes, the data will be safe, but the database might become
corrupted if the operating system crashes or the computer loses power
before that data has been written to the disk surface. On the other hand,
some operations are as much as 50 or more times faster with synchronous OFF."
So, if you have a UPS (with ordered shutdown software!) and are happy with
the OS reliability, I'd consider using "synchronous off" as long as I kept
regular backups, and didn't care if very recent data was lost. (But this is
really the case with most DBs - even with 'synchronous normal' there is a
small risk that the database could be corrupted)
The bottom line is how important is the speed VS Data?
As for detecting a corrupt database, it won't tell you on opening it that
it is corrupt... it will even execute statements till it hits a piece of
the db that is corrupt (at least the corruption that i have seen, which
was from a bad disk, so might not be the same).
What has happened here with data corruption has generally been that the
program has started OK, then crashed later on. (At least, I'm guessing it
was database corruption because the crash happened in the SQLite DLL, and
restoring a backup DB file stopped the crashing)
Paul VPOP3 - Internet Email Server/Gateway
[EMAIL PROTECTED] http://www.pscs.co.uk/