MySQL Forums :: Newbie :: fix "Deadlock found when trying to get lock; try restarting transaction"


Advanced Search

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


Subject Written By Posted
fix "Deadlock found when trying to get lock; try restarting transaction" morteza ir 06/22/2011 04:27AM
Re: fix "Deadlock found when trying to get lock; try restarting transaction" Rick James 06/23/2011 08:41AM
Re: fix "Deadlock found when trying to get lock; try restarting transaction" morteza ir 06/23/2011 09:55AM
Re: fix "Deadlock found when trying to get lock; try restarting transaction" Rick James 06/24/2011 12:03AM
Re: fix "Deadlock found when trying to get lock; try restarting transaction" morteza ir 06/24/2011 03:47AM
Re: fix "Deadlock found when trying to get lock; try restarting transaction" Rick James 06/24/2011 09:25AM
Re: fix "Deadlock found when trying to get lock; try restarting transaction" morteza ir 06/24/2011 01:15PM
Re: fix "Deadlock found when trying to get lock; try restarting transaction" Rick James 06/24/2011 08:44PM
Re: fix "Deadlock found when trying to get lock; try restarting transaction" morteza ir 06/25/2011 01:40AM
Re: fix "Deadlock found when trying to get lock; try restarting transaction" Rick James 06/25/2011 11:30AM


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.