From ebcc9874d4d285ab2b45d62cc4fe89e9830111b7 Mon Sep 17 00:00:00 2001 From: Melanie Date: Thu, 22 Apr 2010 17:45:03 +0100 Subject: Insert a ROLLBACK command on migration step failure. This ensures that updating the Migrations table will not occur in a partial transaction, which would be auto-rolled-back later. --- OpenSim/Data/Migration.cs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'OpenSim/Data/Migration.cs') diff --git a/OpenSim/Data/Migration.cs b/OpenSim/Data/Migration.cs index 4622e23..68e25ef 100644 --- a/OpenSim/Data/Migration.cs +++ b/OpenSim/Data/Migration.cs @@ -146,6 +146,8 @@ namespace OpenSim.Data { m_log.DebugFormat("[MIGRATIONS] Cmd was {0}", cmd.CommandText); m_log.DebugFormat("[MIGRATIONS]: An error has occurred in the migration {0}.\n This may mean you could see errors trying to run OpenSim. If you see database related errors, you will need to fix the issue manually. Continuing.", e.Message); + cmd.CommandText = "ROLLBACK;"; + cmd.ExecuteNonQuery(); } if (version == 0) -- cgit v1.1 From 1b488c25816fd01e893f64cec1a89f5dbac21104 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 23 Apr 2010 20:08:24 +0100 Subject: dispose of the DbCommand used to execute migrations after we've finished with it rather than within the loop disposing of it within the loop causes Mono.Data.Sqlite.dll to get upset, and it's the wrong behaviour anyway --- OpenSim/Data/Migration.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'OpenSim/Data/Migration.cs') diff --git a/OpenSim/Data/Migration.cs b/OpenSim/Data/Migration.cs index 68e25ef..0fb9e78 100644 --- a/OpenSim/Data/Migration.cs +++ b/OpenSim/Data/Migration.cs @@ -159,8 +159,9 @@ namespace OpenSim.Data UpdateVersion(_type, newversion); } version = newversion; - cmd.Dispose(); } + + cmd.Dispose(); } // private int MaxVersion() -- cgit v1.1