MySQL Forums
Forum List  »  InnoDB

Lock wait timeout exceeded; try restarting transaction
Posted by: Claire Humphrey
Date: April 17, 2008 07:30AM

Hello.
Using visual studio.
I have a master table "plans" and a details table "profiles". There are several profiles records for each plan record.
When I update my data,
1) I create a transaction
2) UPDATE the plans table
3) I DELETE all the profiles records associated to that plans record.
4) I try to INSERT a new set of profiles records.
5) Commit my transaction or rollback if the above fails

When I attempt to insert the profiles at stage 4, I'm receiving the error message "Lock wait timeout exceeded; try restarting transaction".

My friend did a google and came up with this...
"Thank you for your bug report but I think your problem is not a bug. Lock waits are expected behavior when you have concurrency. If you have a SELECT or DELETE uncommitted it will hold locks until a commit. Any subsequent SELECT or DELETE requesting the same row has to wait release of this lock.
Thus if your program dies and mysql-python does not rollback changes automatically locks requested by the transaction will be hold and might cause lock waits (commit is not possible because transactions must be atomic). If you have a lock wait you can rollback all the changes and reissue the transaction."

Is this the cause of my problem?
If so, how do I do this correctly? Should I be inserting the new records before deleting the old?

Options: ReplyQuote


Subject
Views
Written By
Posted
Lock wait timeout exceeded; try restarting transaction
3910
April 17, 2008 07: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.