MySQL Forums
Forum List  »  Newbie

fix "Deadlock found when trying to get lock; try restarting transaction"
Posted by: morteza ir
Date: June 22, 2011 04:27AM

I have transaction block that is contain 5 updates and insert on 4 table like below. When i run this transaction concurrency (for example 1000 in the same time). The mysql thow the exception of "Deadlock found when trying to get lock; try restarting transaction"
In 1000, there are about 250 deadlock excepion. I know this caouse of conflict in tables locking.
But how can i improve it? Is there anyway to completely fix it?

start transaction;
update table_1 ......
update table_2 .......
insert table_2 .......
update table_3 .....
update table_4 .....
commit;

Best Regards.
morteza

Options: ReplyQuote




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.