Welcome Guest | Login

ERROR 1205 (HY000): Lock wait timeout exceeded; try restarting transaction

I was importing about 7600 records into my database. this worked the first time I performed the action; however, when I tried it again, the operation timed out. I tried to purge all records from the table, using the mysql utility, but keep receiving the error message, "ERROR 1205 (HY000): Lock wait timeout exceeded; try restarting transaction" I tried using a regular "delete from <tablename>" and "truncate table <tablename>," but I get this even if I restrict my delete statement to one row.

Any ideas on how I can get past this?

Thank you.

2008-07-16 10:01 AM

Hi- 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 (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.

2008-07-16 01:58 PM

HostingRails Support
Thank you for your explanation. That makes perfect sense, since the rails app hung during the import process. However, I'm not sure how to release the lock. Can you provide any assistance on how to roll back the transaction and release the lock?

2008-07-16 02:23 PM

Hi - Please refer the following link for syntax for rollbacking transactions in MySQL.

http://dev.mysql.com/doc/refman/5.0/en/commit.html

2008-07-16 03:42 PM

HostingRails Support
Unfortunately at this point I cannot rollback the transaction, since it was started by rails quite awhile ago. There is no visible record of a hung transaction that I can see. At this point I would think the mysql instance would have to be restart; however, I do not believe I have access to do this on a shared account. Should I open up a help desk ticket at this point or is there something else I can try?

2008-07-16 05:39 PM

Hi - Post a ticket to support team, we will help you with it.

2008-07-16 05:47 PM

HostingRails Support

Hello Guest! In order to post you must be an active client with us, please log in or sign up today!