On Aug 17, 2010, at 1:48 AM, Nikolaus Rath wrote:

> Hello,
>
> The script below fails with
>
> Deadlock detected when executing 'DELETE FROM foo WHERE id=2'
>
> What I think should be happening instead is this:
>
> - When executing statement 1, the main thread obtains a SHARED lock.
>
> - When executing statement 2, the main thread briefly obtains an
>   EXCLUSIVE lock. After statement 2 is executed, the EXCLUSIVE lock is
>   released and the main thread continues to hold the SHARED lock  
> (since
>   statement 1 is still active)
>
> - Thread 2 wants to get an EXCLUSIVE lock but it can't. So the busy
>   handlers waits for the main thread to release it's lock.
>
> - The main thread once again briefly obtains an EXCLUSIVE lock to
>   execute statement 4. After that it releases all locks.
>
> - Now thread 2 can execute statement 3.
>
>
> Obviously, in practice something else is happening. Can someone  
> explain
> what and why this is?

What does sqlite3_version() say?


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

Reply via email to