larrybuntus larrybuntus - 1 year ago 39
MySQL Question

How to update data in MySql table with grails?

I have tried for days without success to update the records in my

database using grails. I always get a
which is caused by:

Lock wait timeout exceeded

Here is the code I am using:

def campaignUpdater(id, details){
def dbData = Campaigns.get(id)
dbData.totalSent = details.totalSent
dbData.totalQueued = details.totalQueued
dbData.totalFailed = details.totalFailed
dbData.uniqueClickers = details.uniqueClickers
dbData.opened = details.opened true, failOnError: true)
return true
return false

I really need help as soon as possible.

Answer Source

Lock wait timeout exceeded exception is either caused if there is a deadlock and Mysql is unable to detect it, or if you have a very long running query.

You probably have a InnoDB engine problem. Most likely you'll need to kill some processes inorder for your queries to run properly. See these answers for more info.