On 3/28/2011 3:45 PM, Boris Kolpackov wrote: > As expected, I periodically get deadlocks (SQLITE_LOCKED return code from > unlock_notify()) for the second transaction due to the read to write > lock upgrade. But I also get deadlocks reported for the first transaction > and this is something that I didn't expect to happen. My reasoning is > that this transaction tries to get the write lock right away so I don't > see how it can be blocking some other transaction. Can someone explain > this? > > The first transaction behaves as if, for some reason, it first obtained > the read lock and then tried to upgrade it to the write lock.
No, it first obtained a RESERVED lock, and later tries to promote it to EXCLUSIVE lock. You can't have a deadlock with just one transaction being locked out. A deadlock, by definition, involves two transactions that mutually prevent each other from making progress. -- Igor Tandetnik _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users