Re: why UPDATE requires share lock(S) for table joined
Posted by:
Rick James
Date: November 17, 2014 12:07AM
BEGIN;
UPDATE ... WHERE x=11;
UPDATE ... WHERE x=222;
COMMIT;
and at the same time, from another connection:
BEGIN;
UPDATE ... WHERE x=222;
UPDATE ... WHERE x=11;
COMMIT;
That will cause a deadlock. One of the transactions will be ROLLBACKed.
Regardless of transaction isolation level, you cannot prevent all deadlocks.
Do this right after a deadlock; it will provide the specifics.
SHOW ENGINE=InnoDB STATUS;
Then we can discuss why it happened, and what can be done about it.
Subject
Views
Written By
Posted
1857
November 12, 2014 01:03AM
1013
November 13, 2014 09:58AM
1063
November 14, 2014 03:07AM
1207
November 14, 2014 01:08PM
1060
November 16, 2014 11:19PM
Re: why UPDATE requires share lock(S) for table joined
1034
November 17, 2014 12:07AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.