On 5/24/2012 9:27 PM, Andrew Cherednik wrote:
Do you use explicit transactions? If yes, do any of those follow the pattern
where you start with a SELECT, and then perform an INSERT or UPDATE or DELETE
(in other words, a transaction starts as a
reader, and then wants to upgrade to a writer)? This situation may lead to a
deadlock. If you have such transactions, start them with BEGIN IMMEDIATE
statement.
Yes, I have a lot of transactions like this. Do I need to start with BEGIN
IMMEDIATE before first select, or before an update command?
Before first select. Use BEGIN IMMEDIATE instead of regular BEGIN, to
start the transaction.
--
Igor Tandetnik
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users