On 6 Nov 2014, at 3:13am, Andrei Yakimov <anj...@gmail.com> wrote:

> Problem is incorrect journal file, which is created on system reboot.
> Reproduce this condition relativity simple:
> 
> step 1:  we open db
> step 2:  write/update something to db.
> step 3:  switch journal to memory
> step 4:  write/update something to db.
> Do not close you SW keep it running and DB open
> step 5:  reboot your system or kill you SW not gracefully.

Please see

<http://www.sqlite.org/pragma.html#pragma_journal_mode>

"The MEMORY journaling mode stores the rollback journal in volatile RAM. This 
saves disk I/O but at the expense of database safety and integrity. If the 
application using SQLite crashes in the middle of a transaction when the MEMORY 
journaling mode is set, then the database file will very likely go corrupt."

In other words, SQLite is operating as designed.  The ability to keep the 
journal in memory is supplied for databases where, if the system crashes, you 
would have to begin the task again anyway.  If you need your database to be 
recoverable after a crash, sorry, but you can't use that mode.

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

Reply via email to