From 80520206fcd4c8c85eb28b4800c42136365b164d Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Mon, 1 Dec 2008 18:42:14 +0000 Subject: * Unforunately it turns out not to be that simple. Revert the rest of r7560 for now. --- OpenSim/Data/Migration.cs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'OpenSim/Data/Migration.cs') diff --git a/OpenSim/Data/Migration.cs b/OpenSim/Data/Migration.cs index 332b8ec..8fbf789 100644 --- a/OpenSim/Data/Migration.cs +++ b/OpenSim/Data/Migration.cs @@ -82,7 +82,6 @@ namespace OpenSim.Data // private static readonly string _migrations_init = "insert into migrations values('migrations', 1)"; // private static readonly string _migrations_find = "select version from migrations where name='migrations'"; - public Migration(DbConnection conn, Assembly assem, string type) { _type = type; @@ -113,7 +112,6 @@ namespace OpenSim.Data DbCommand cmd = _conn.CreateCommand(); cmd.CommandText = _migrations_create; cmd.ExecuteNonQuery(); - cmd.Dispose(); InsertVersion("migrations", 1); } @@ -137,7 +135,7 @@ namespace OpenSim.Data int newversion = kvp.Key; cmd.CommandText = kvp.Value; // we need to up the command timeout to infinite as we might be doing long migrations. - //cmd.CommandTimeout = 0; + cmd.CommandTimeout = 0; cmd.ExecuteNonQuery(); if (version == 0) @@ -149,7 +147,6 @@ namespace OpenSim.Data UpdateVersion(_type, newversion); } version = newversion; - cmd.Dispose(); } } @@ -192,7 +189,7 @@ namespace OpenSim.Data DbCommand cmd = conn.CreateCommand(); try { - cmd.CommandText = "select version from migrations where name='" + type +"' order by version desc"; + cmd.CommandText = "select version from migrations where name='" + type + "' limit 1"; using (IDataReader reader = cmd.ExecuteReader()) { if (reader.Read()) @@ -206,7 +203,6 @@ namespace OpenSim.Data { // Something went wrong, so we're version 0 } - cmd.Dispose(); return version; } @@ -216,7 +212,6 @@ namespace OpenSim.Data cmd.CommandText = "insert into migrations(name, version) values('" + type + "', " + version + ")"; m_log.InfoFormat("[MIGRATIONS]: Creating {0} at version {1}", type, version); cmd.ExecuteNonQuery(); - cmd.Dispose(); } private void UpdateVersion(string type, int version) @@ -225,7 +220,6 @@ namespace OpenSim.Data cmd.CommandText = "update migrations set version=" + version + " where name='" + type + "'"; m_log.InfoFormat("[MIGRATIONS]: Updating {0} to version {1}", type, version); cmd.ExecuteNonQuery(); - cmd.Dispose(); } // private SortedList GetAllMigrations() -- cgit v1.1