this is a believed fix for some of the MySQL races. Testing would

be appreciated.
0.6.0-stable
Sean Dague 2008-03-13 17:42:07 +00:00
parent 67a59b62e3
commit 1ad041707a
1 changed files with 24 additions and 29 deletions

View File

@ -158,10 +158,9 @@ namespace OpenSim.Framework.Data.MySQL
// m_log.Info("[DATASTORE]: Ignoring Physical obj: " + obj.UUID + " in region: " + regionUUID); // m_log.Info("[DATASTORE]: Ignoring Physical obj: " + obj.UUID + " in region: " + regionUUID);
} }
} }
}
Commit(); Commit();
} }
}
public void RemoveObject(LLUUID obj, LLUUID regionUUID) public void RemoveObject(LLUUID obj, LLUUID regionUUID)
{ {
@ -192,10 +191,9 @@ namespace OpenSim.Framework.Data.MySQL
// Remove prim row // Remove prim row
row.Delete(); row.Delete();
} }
}
Commit(); Commit();
} }
}
/// <summary> /// <summary>
/// Remove all persisted items of the given prim. /// Remove all persisted items of the given prim.
@ -369,6 +367,8 @@ namespace OpenSim.Framework.Data.MySQL
m_connection.Open(); m_connection.Open();
} }
lock (m_dataSet)
{
using (MySqlDataReader row = cmd.ExecuteReader()) using (MySqlDataReader row = cmd.ExecuteReader())
{ {
int rev = 0; int rev = 0;
@ -393,7 +393,7 @@ namespace OpenSim.Framework.Data.MySQL
m_log.Info("[DATASTORE]: Loaded terrain revision r" + rev.ToString()); m_log.Info("[DATASTORE]: Loaded terrain revision r" + rev.ToString());
} }
}
return terret; return terret;
} }
@ -417,13 +417,8 @@ namespace OpenSim.Framework.Data.MySQL
} }
} }
static Random rnd = new Random();
public void StoreLandObject(Land parcel, LLUUID regionUUID) public void StoreLandObject(Land parcel, LLUUID regionUUID)
{ {
// Does the new locking fix it?
m_log.Info("[DATASTORE]: Tedds temp fix: Waiting 3 seconds to avoid others writing to table while we hold a dataset of it. (Someone please fix! :))");
System.Threading.Thread.Sleep(2500 + rnd.Next(0, 1000));
lock (m_dataSet) lock (m_dataSet)
{ {
DataTable land = m_landTable; DataTable land = m_landTable;
@ -456,9 +451,9 @@ namespace OpenSim.Framework.Data.MySQL
landaccesslist.Rows.Add(newAccessRow); landaccesslist.Rows.Add(newAccessRow);
} }
}
Commit(); Commit();
} }
}
public List<LandData> LoadLandObjects(LLUUID regionUUID) public List<LandData> LoadLandObjects(LLUUID regionUUID)
{ {