Re: [sqlite] unexpected deadlocks in shared cache mode with unlock_notify

2011-03-29 Thread Boris Kolpackov
Hi, Boris Kolpackov writes: > Half of the threads executes the following transaction: > > BEGIN > INSERT > INSERT > INSERT > COMMIT > > The other half of the threads runs the following transaction: > > BEGIN > SELECT > UPDATE > COMMIT > > As expected, I periodically get

Re: [sqlite] unexpected deadlocks in shared cache mode with unlock_notify

2011-03-29 Thread Boris Kolpackov
Hi Simon, Simon Slavin writes: > On 29 Mar 2011, at 10:48am, Boris Kolpackov wrote: > > > If I add IMMEDIATE (or EXCLUSIVE) to the first transaction > > (three INSERTs), nothing changes, [snip] > > > > If I add IMMEDIATE to the second transaction (SELECT then UPDATE), then > > the deadlocks go

Re: [sqlite] unexpected deadlocks in shared cache mode with unlock_notify

2011-03-29 Thread Simon Slavin
On 29 Mar 2011, at 10:48am, Boris Kolpackov wrote: > If I add IMMEDIATE (or EXCLUSIVE) to the first transaction > (three INSERTs), nothing changes, [snip] > > If I add IMMEDIATE to the second transaction (SELECT then UPDATE), then > the deadlocks go away for both transaction as one would

Re: [sqlite] unexpected deadlocks in shared cache mode with unlock_notify

2011-03-29 Thread Boris Kolpackov
Hi Simon, Simon Slavin writes: > On 28 Mar 2011, at 8:45pm, 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

Re: [sqlite] unexpected deadlocks in shared cache mode with unlock_notify

2011-03-28 Thread Simon Slavin
On 28 Mar 2011, at 8:45pm, 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

Re: [sqlite] unexpected deadlocks in shared cache mode with unlock_notify

2011-03-28 Thread Boris Kolpackov
Hi Igor, Igor Tandetnik writes: > On 3/28/2011 3:45 PM, Boris Kolpackov wrote: > > > > 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

Re: [sqlite] unexpected deadlocks in shared cache mode with unlock_notify

2011-03-28 Thread Igor Tandetnik
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