On Sat, Nov 30, 2013 at 5:15 PM, L. Wood <lwoo...@live.com> wrote:

> Thanks, that makes sense.
>
> But I can pretty much rule this case out. In my case, it's highly unlikely
> that the folder would be moved during the brief instant between _open() and
> the actual opening of the "-journal" file.
>
> Are there other possible cases of corruption?
>



(1)  Process A opens database at /first/path/to/database.db
(2)  The directory is renamed to /second/path/to/database.db
(3)  Process B begins writing to the database, creating a rollback journal
at /second/path/to/database.db-journal
(4)  Process B crashes without committing or rolling back.
(5)  Process A tries to read the database.  It checks for a hot journal
file at /first/path/to/database.db-journal, finds none (since the hot
journal is now in a different place) and therefore does not know that it
needs to recover the database file.  It sees the database as being corrupt.
Or if A tries to write to the database, it makes the corruption worse, such
that even a third process that does see the hot journal is no longer able
to recover.


-- 
D. Richard Hipp
d...@sqlite.org
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to