aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs5
1 files changed, 5 insertions, 0 deletions
diff --git a/OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs b/OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs
index cd1c94a..6540b6d 100644
--- a/OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs
+++ b/OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs
@@ -247,6 +247,7 @@ namespace OpenSim.DataStore.MonoSqlite
247 { 247 {
248 int revision = Util.UnixTimeSinceEpoch(); 248 int revision = Util.UnixTimeSinceEpoch();
249 SqliteConnection conn = new SqliteConnection(connectionString); 249 SqliteConnection conn = new SqliteConnection(connectionString);
250 conn.Open();
250 MainLog.Instance.Verbose("DATASTORE", "Storing terrain revision r" + revision.ToString()); 251 MainLog.Instance.Verbose("DATASTORE", "Storing terrain revision r" + revision.ToString());
251 252
252 DataTable terrain = ds.Tables["terrain"]; 253 DataTable terrain = ds.Tables["terrain"];
@@ -263,11 +264,13 @@ namespace OpenSim.DataStore.MonoSqlite
263 cmd.ExecuteNonQuery(); 264 cmd.ExecuteNonQuery();
264 } 265 }
265 } 266 }
267 conn.Close();
266 } 268 }
267 269
268 public double[,] LoadTerrain(LLUUID regionID) 270 public double[,] LoadTerrain(LLUUID regionID)
269 { 271 {
270 SqliteConnection conn = new SqliteConnection(connectionString); 272 SqliteConnection conn = new SqliteConnection(connectionString);
273 conn.Open();
271 double[,] terret = new double[256,256]; 274 double[,] terret = new double[256,256];
272 terret.Initialize(); 275 terret.Initialize();
273 String sql = "select RegionUUID, Revision, Heightfield from terrain" + 276 String sql = "select RegionUUID, Revision, Heightfield from terrain" +
@@ -299,12 +302,14 @@ namespace OpenSim.DataStore.MonoSqlite
299 else 302 else
300 { 303 {
301 MainLog.Instance.Verbose("DATASTORE", "No terrain found for region"); 304 MainLog.Instance.Verbose("DATASTORE", "No terrain found for region");
305 conn.Close();
302 return null; 306 return null;
303 } 307 }
304 308
305 MainLog.Instance.Verbose("DATASTORE", "Loaded terrain revision r" + rev.ToString()); 309 MainLog.Instance.Verbose("DATASTORE", "Loaded terrain revision r" + rev.ToString());
306 } 310 }
307 } 311 }
312 conn.Close();
308 return terret; 313 return terret;
309 } 314 }
310 315