Forum: Ruby on Rails My sql error: Lock wait timeout

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
F16e67cf8c0d59e1b98f5ba46d84b31d?d=identicon&s=25 Sriram Varahan (sriram)
on 2009-04-14 09:33
Hello,

I have this application where there are 5 tables.

I have the :dependent => :destroy clause  in such a way that if an entry
in the first table is deleted all the "dependent" entries in the next 4
tables are also destroyed.

The issue is there are thousands of entries in the tables and this is
taking a lot of time and I get a mysql error:

Mysql::Error: Lock wait timeout exceeded; try restarting transaction

Because of this I am not able to destroy an entry.

I tried increasing the lock wait timeout time in the mysql configuration
file. But still no improvement.

Any help would be appreciated.

Thanks.
054ea2f04b5592b91f8223796cc53979?d=identicon&s=25 Brendon Whateley (brendon)
on 2009-04-14 16:39
(Received via mailing list)
Do you have the correct indexes set on the tables?  It sounds like you
need to make the the delete operation far faster.

On Apr 14, 12:33 am, Sriram Varahan <rails-mailing-l...@andreas-s.net>
This topic is locked and can not be replied to.