From 7e3564f6a03ae3d40602b4cbf604ad56e1f2782c Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Fri, 8 Oct 2010 07:57:27 +0000 Subject: Move the line error messages out of the transaction when importing. Stangely enough, I saw a case where the logme resulted in an error, and the whole transaction was lost. --- weblog-model.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/weblog-model.lua b/weblog-model.lua index a69f417..f5f339c 100644 --- a/weblog-model.lua +++ b/weblog-model.lua @@ -876,6 +876,7 @@ local function importlogfile(source, cookiesfile, file, parselog_func, importlog pcall(function() con:execute("ROLLBACK") end) else assert(con:execute("ROLLBACK TO before_line")) + con:execute("COMMIT") end pcall(function() logme("Exception on line:"..line) end) if err2 then @@ -883,6 +884,8 @@ local function importlogfile(source, cookiesfile, file, parselog_func, importlog end if (config.stoponerror == "true") then assert(res2, "Import halted on exception") + else + con:execute("START TRANSACTION") end end end -- cgit v1.2.3