I have a query in which I am updating a table and have used ININ
keyword in the query.
The query is something like this :
UPDATE q
SET b_id = 123
WHERE id IN (SELECT id FROM q WHERE b_id IS NULL LIMIT 1)
There is another query in which I am inserting data in table
he. The query is :
INSERT INTO q (id, item) VALUES (@id, @item)
Both theThe queries are executing in differencton different threads, while executing 2nd query i.e. INSERTWhile executing the second (INSERT
) query I am getting database is locked error.
What is the rasonreason?
TIAid
is not primary key.