Re: [sqlite] synchronization issue: no directory sync after unlink

2012-02-23 Thread Pavel Ivanov
AFAIK, before deleting journal file SQLite writes some zeroed header into it. This kind of header means that transaction is finished. And even if after power shutdown SQLite finds this journal persisting on disk it will see the header and will understand that this journal just needs to be deleted.

Re: [sqlite] synchronization issue: no directory sync after unlink

2012-02-23 Thread Florent Bayendrian
The header is overwritten with some zeros only if I change the journal_mode to PERSIST : http://www.sqlite.org/pragma.html#pragma_journal_mode By default, the journal_mode is set to DELETE so the journal file is valid if the file is present after an unlink + power shutdown. (I have checked with

Re: [sqlite] synchronization issue: no directory sync after unlink

2012-02-23 Thread Dan Kennedy
On 02/23/2012 06:02 PM, Florent Bayendrian wrote: Hi, I have a synchronization issue on an embedded device running Linux : if a power shutdown is done just after a commit, sqlite will restore the database to the previous state using the journal file. At the end of a transaction the unlink of

[sqlite] synchronization issue: no directory sync after unlink

2012-02-23 Thread Florent Bayendrian
Hi, I have a synchronization issue on an embedded device running Linux : if a power shutdown is done just after a commit, sqlite will restore the database to the previous state using the journal file. At the end of a transaction the unlink of the journal file is not enough, the journal could