On Aug 24, 2010, at 10:57 AM, Nikolaus Rath wrote: > Nikolaus Rath <nikolaus-bth8mxji...@public.gmane.org> writes: >> Still no one able to clarify the issues raised in this thread? >> >> Let me try to summarize what I still don't understand: >> >> - Will SQLite acquire and release an EXCLUSIVE lock while keeping a >> SHARED lock if one executes a UPDATE query with one cursor while a >> different cursor is in the middle of a SELECT query, >> >> -or- >> >> will the EXCLUSIVE lock be held until the SELECT query finishes?
If you want the main thread to hold an exclusive lock until the work is completed (which would prevent the deadlock) put the SELECT and DELETE queries in a transaction using BEGIN IMMEDIATE or BEGIN EXCLUSIVE. Then the EXCLUSIVE lock be held until the SELECT query finishes. Alternatively, finalize the SELECT before doing the DELETE. e _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users