ON DUPLICATE KEY导致MySQL死锁

时间:2016-03-25 19:55:10

标签: mysql

我正在运行以下查询,以根据原籍国记录流量的汇总统计信息:

bypassthis:

If tempfilepath <> "" Then

'close excel (save) and release objects
    xlhwnd = xlApp.Hwnd    '<------ warning here
    ProcIDxl = 0
    xproc = Process.GetProcessById(ProcIDxl)
    GetWindowThreadProcessId(xlhwnd, ProcIDxl)

    xlWorkBooks(tempfile).Close(True)    '<------ warning here
    xlApp.Application.Quit()

    GC.Collect()
    GC.WaitForPendingFinalizers()

    releaseObject(xlWorkSheet)    '<------ warning here
    releaseObject(xlWorkSheets)    '<------ warning here
    releaseObject(xlWorkBook)    '<------ warning here
    releaseObject(xlWorkBooks)
    releaseObject(xlApp)

    xlWorkSheet = Nothing
    xlWorkSheets = Nothing
    xlWorkBook = Nothing
    xlWorkBooks = Nothing
    xlApp = Nothing

End If

不幸的是,它经常运行此查询,似乎导致某种行死锁状态,我有很多连接将永远睡眠。

有什么方法可以轻松解决这个问题,同时保持&#34;重复&#34;条件?

或者我是否必须为每个country_id手动创建一行并运行一个简单的更新?

0 个答案:

没有答案