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. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> 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. > -- > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Seemingly Similar Threads
- Mysql::Error: Lock wait timeout exceeded; try restarting transaction
- ActiveRecord::StatementInvalid: Mysql::Error: Lock wait timeout exceeded
- Mysql "lock wait timeout" tuning
- [LLVMdev] Improving the usability of LNT
- Extracting data from SQL Server based on R parameters