From 462fc84eb21b54754b749b2a4f3fa55a55a41680 Mon Sep 17 00:00:00 2001 From: Tedd Hansen Date: Sat, 19 Jan 2008 21:42:03 +0000 Subject: Removed mega-debugging. Possibly solved startup crash. Moved MySQL Commit() to inside each functions respective dataset access mutex because if not other threads would be waiting until function released mutex and modify the dataset before the function could commit --- OpenSim/Framework/Data.MySQL/MySQLDataStore.cs | 33 ++++++-------------------- 1 file changed, 7 insertions(+), 26 deletions(-) (limited to 'OpenSim/Framework/Data.MySQL') diff --git a/OpenSim/Framework/Data.MySQL/MySQLDataStore.cs b/OpenSim/Framework/Data.MySQL/MySQLDataStore.cs index 7929c0d..d9a39a3 100644 --- a/OpenSim/Framework/Data.MySQL/MySQLDataStore.cs +++ b/OpenSim/Framework/Data.MySQL/MySQLDataStore.cs @@ -156,9 +156,9 @@ namespace OpenSim.Framework.Data.MySQL // MainLog.Instance.Verbose("DATASTORE", "Ignoring Physical obj: " + obj.UUID + " in region: " + regionUUID); } } - } Commit(); + } } public void RemoveObject(LLUUID obj, LLUUID regionUUID) @@ -198,9 +198,9 @@ namespace OpenSim.Framework.Data.MySQL // Remove prim row row.Delete(); } - } Commit(); + } } /// @@ -418,57 +418,38 @@ namespace OpenSim.Framework.Data.MySQL { lock (m_dataSet) { - MainLog.Instance.Verbose("DATASTORE", "Tedd debug: 1"); DataTable land = m_landTable; - MainLog.Instance.Verbose("DATASTORE", "Tedd debug: 2"); DataTable landaccesslist = m_landAccessListTable; - MainLog.Instance.Verbose("DATASTORE", "Tedd debug: 3"); DataRow landRow = land.Rows.Find(Util.ToRawUuidString(parcel.landData.globalID)); - MainLog.Instance.Verbose("DATASTORE", "Tedd debug: 4"); if (landRow == null) { - MainLog.Instance.Verbose("DATASTORE", "Tedd debug: 5"); landRow = land.NewRow(); - MainLog.Instance.Verbose("DATASTORE", "Tedd debug: 6"); fillLandRow(landRow, parcel.landData, regionUUID); - MainLog.Instance.Verbose("DATASTORE", "Tedd debug: 7"); land.Rows.Add(landRow); } else { - MainLog.Instance.Verbose("DATASTORE", "Tedd debug: 8"); fillLandRow(landRow, parcel.landData, regionUUID); } - MainLog.Instance.Verbose("DATASTORE", "Tedd debug: 9"); using ( MySqlCommand cmd = new MySqlCommand("delete from landaccesslist where LandUUID=?LandUUID", m_connection)) { - MainLog.Instance.Verbose("DATASTORE", "Tedd debug: 10"); cmd.Parameters.Add(new MySqlParameter("?LandUUID", Util.ToRawUuidString(parcel.landData.globalID))); - MainLog.Instance.Verbose("DATASTORE", "Tedd debug: 11"); cmd.ExecuteNonQuery(); } - MainLog.Instance.Verbose("DATASTORE", "Tedd debug: 12"); - int i = 0; foreach (ParcelManager.ParcelAccessEntry entry in parcel.landData.parcelAccessList) { - i++; - MainLog.Instance.Verbose("DATASTORE", "Tedd debug: 12:1:" + i); DataRow newAccessRow = landaccesslist.NewRow(); - MainLog.Instance.Verbose("DATASTORE", "Tedd debug: 12:2:" + i); fillLandAccessRow(newAccessRow, entry, parcel.landData.globalID); - MainLog.Instance.Verbose("DATASTORE", "Tedd debug: 12:3:" + i); landaccesslist.Rows.Add(newAccessRow); } - } - MainLog.Instance.Verbose("DATASTORE", "Tedd debug: 13"); Commit(); - MainLog.Instance.Verbose("DATASTORE", "Tedd debug: 14"); + } } public List LoadLandObjects(LLUUID regionUUID) @@ -536,8 +517,6 @@ namespace OpenSim.Framework.Data.MySQL m_connection.Open(); } - lock (m_dataSet) - { // DisplayDataSet(m_dataSet, "Region DataSet"); m_primDataAdapter.Update(m_primTable); @@ -553,12 +532,14 @@ namespace OpenSim.Framework.Data.MySQL m_landAccessListDataAdapter.Update(m_landAccessListTable); m_dataSet.AcceptChanges(); - } } public void Shutdown() { - Commit(); + lock (m_dataSet) + { + Commit(); + } } /*********************************************************************** -- cgit v1.1