add locking to the terrain database calls

afrisby
Sean Dague 2007-10-23 14:31:35 +00:00
parent 42318dc15a
commit 0d93069adb
1 changed files with 31 additions and 28 deletions

View File

@ -233,13 +233,14 @@ namespace OpenSim.DataStore.MonoSqlite
MainLog.Instance.Verbose("DATASTORE", "Storing terrain revision r" + revision.ToString());
DataTable terrain = ds.Tables["terrain"];
lock (ds) {
DataRow newrow = terrain.NewRow();
fillTerrainRow(newrow, regionID, revision, ter);
terrain.Rows.Add(newrow);
Commit();
}
}
public double[,] LoadTerrain(LLUUID regionID)
{
@ -248,6 +249,7 @@ namespace OpenSim.DataStore.MonoSqlite
DataTable terrain = ds.Tables["terrain"];
lock (ds) {
DataRow[] rows = terrain.Select("RegionUUID = '" + regionID.ToString() + "'","Revision DESC");
int rev = 0;
@ -275,6 +277,7 @@ namespace OpenSim.DataStore.MonoSqlite
MainLog.Instance.Verbose("DATASTORE", "Loaded terrain revision r" + rev.ToString());
}
return terret;
}