Thank you for your responses Simon and Richard.  To your questions:

> Are you using any PRAGMAs apart from "PRAGMA synchronous" ?

PRAGMA temp_store=1 (file)
PRAGMA cache_size=2000
PRAGMA page_size=4096
sqlite3_soft_heap_limit( 1GB )

Those are the only non-default settings.

> Are you testing the result codes of /all/ your sqlite3_ calls

Yes.  But I usually don't see the full log to see if something has happened 
earlier.  I'll have to track down a log and see if the corruption error is the 
first one that happens.

> are you replacing it with a known good one before continuing

Yes.  Once we get the report, the user has to delete the file and start fresh 
with an empty database.

> Depends on whether you are using WAL mode or not.

I am not using WAL.

Doug


-----Original Message-----
From: sqlite-users-bounces at mailinglists.sqlite.org 
[mailto:sqlite-users-boun...@mailinglists.sqlite.org] On Behalf Of Simon Slavin
Sent: Monday, March 2, 2015 3:47 PM
To: General Discussion of SQLite Database
Subject: Re: [sqlite] PRAGMA Synchronous safety


On 2 Mar 2015, at 4:45pm, Doug Nebeker <admin at poweradmin.com> wrote:

> 1. Is setting synchronous to FULL necessary to prevent these corruption 
> problems?

You should not be getting this corruption problem, so I don't know whether FULL 
would cure it.

> 2. NORMAL is much slower than NONE.  Is FULL much slower than NORMAL?

Sorry but it's too hard to predict 'much' since the amount of time taken varies 
with different versions of the OS, width of the data bus, disk format, and 
other such things.  All you can do is try it on your own specific setup.

In the meantime ...

Are you using any PRAGMAs apart from "PRAGMA synchronous" ?

Are you testing the result codes of /all/ your sqlite3_ calls to check that 
they're SQLITE_OK ?  Sometimes it's not the expected call which causes the 
corruption, or which first returns an error because the database is corrupt.

Once the database is reported as corrupt, are you replacing it with a known 
good one before continuing ?  Corruption is not automatically fixed and once a 
database is corrupt it will remain corrupt until something is done about it.

Simon.
_______________________________________________
sqlite-users mailing list
sqlite-users at mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to