On Sat, Jun 23, 2012 at 10:36 PM, Dennis Volodomanov <i...@psunrise.com> wrote: > On 24/06/2012 12:29 PM, Pavel Ivanov wrote: >> >> AFAIK, checkpoints are application-specific, but SQLite prohibits >> second writer until first one committed its transaction and released >> database lock. So there can't be such thing as "two writers, both >> writing to the same DB". If one writer writes, another one is locked >> out and waits. And btw checkpoint cannot be completed if there are >> some application with transactions that started before last commit to >> the database was made. Although partial checkpoint is possible in such >> situation. > > Doesn't this suggest, though, that if the first writer crashes during a > checkpoint, the second writer will be forever locked out? Or is there some > internal mechanism that takes care of that?
Yes, internally SQLite uses OS-level file locks. When process crashes or goes away by any other reason OS clears all locks it held, so other writer sees database unlocked and is able to proceed. Pavel _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users