diff options
author | Tedd Hansen | 2008-02-02 05:14:50 +0000 |
---|---|---|
committer | Tedd Hansen | 2008-02-02 05:14:50 +0000 |
commit | 1fa510d26dcc3b1e223b068ea8fafdae45ac6a40 (patch) | |
tree | e5eabca38ccfb10d4bc02724338265581291d00d | |
parent | Re-enabled AllowedCompilers function (diff) | |
download | opensim-SC-1fa510d26dcc3b1e223b068ea8fafdae45ac6a40.zip opensim-SC-1fa510d26dcc3b1e223b068ea8fafdae45ac6a40.tar.gz opensim-SC-1fa510d26dcc3b1e223b068ea8fafdae45ac6a40.tar.bz2 opensim-SC-1fa510d26dcc3b1e223b068ea8fafdae45ac6a40.tar.xz |
And one more patch before sleep
This annoying sleep during startup-problem still sometimes causes exceptions, so added some retry...
-rw-r--r-- | OpenSim/Framework/Data.MySQL/MySQLDataStore.cs | 71 | ||||
-rw-r--r-- | bin/OpenSim.ini.example | 1 |
2 files changed, 43 insertions, 29 deletions
diff --git a/OpenSim/Framework/Data.MySQL/MySQLDataStore.cs b/OpenSim/Framework/Data.MySQL/MySQLDataStore.cs index 478816c..6523105 100644 --- a/OpenSim/Framework/Data.MySQL/MySQLDataStore.cs +++ b/OpenSim/Framework/Data.MySQL/MySQLDataStore.cs | |||
@@ -418,41 +418,56 @@ namespace OpenSim.Framework.Data.MySQL | |||
418 | { | 418 | { |
419 | MainLog.Instance.Verbose("DATASTORE", "Tedds temp fix: Waiting 3 seconds for stuff to catch up. (Someone please fix! :))"); | 419 | MainLog.Instance.Verbose("DATASTORE", "Tedds temp fix: Waiting 3 seconds for stuff to catch up. (Someone please fix! :))"); |
420 | System.Threading.Thread.Sleep(3000); | 420 | System.Threading.Thread.Sleep(3000); |
421 | |||
422 | lock (m_dataSet) | ||
423 | { | ||
424 | DataTable land = m_landTable; | ||
425 | DataTable landaccesslist = m_landAccessListTable; | ||
426 | 421 | ||
427 | DataRow landRow = land.Rows.Find(Util.ToRawUuidString(parcel.landData.globalID)); | 422 | int loopCount = 0; |
428 | if (landRow == null) | 423 | while (true) |
429 | { | 424 | { |
430 | landRow = land.NewRow(); | 425 | loopCount++; |
431 | fillLandRow(landRow, parcel.landData, regionUUID); | 426 | try |
432 | land.Rows.Add(landRow); | ||
433 | } | ||
434 | else | ||
435 | { | 427 | { |
436 | fillLandRow(landRow, parcel.landData, regionUUID); | 428 | lock (m_dataSet) |
437 | } | 429 | { |
430 | DataTable land = m_landTable; | ||
431 | DataTable landaccesslist = m_landAccessListTable; | ||
438 | 432 | ||
439 | using ( | 433 | DataRow landRow = land.Rows.Find(Util.ToRawUuidString(parcel.landData.globalID)); |
440 | MySqlCommand cmd = | 434 | if (landRow == null) |
441 | new MySqlCommand("delete from landaccesslist where LandUUID=?LandUUID", m_connection)) | 435 | { |
442 | { | 436 | landRow = land.NewRow(); |
443 | cmd.Parameters.Add(new MySqlParameter("?LandUUID", Util.ToRawUuidString(parcel.landData.globalID))); | 437 | fillLandRow(landRow, parcel.landData, regionUUID); |
444 | cmd.ExecuteNonQuery(); | 438 | land.Rows.Add(landRow); |
445 | } | 439 | } |
440 | else | ||
441 | { | ||
442 | fillLandRow(landRow, parcel.landData, regionUUID); | ||
443 | } | ||
446 | 444 | ||
447 | foreach (ParcelManager.ParcelAccessEntry entry in parcel.landData.parcelAccessList) | 445 | using ( |
446 | MySqlCommand cmd = | ||
447 | new MySqlCommand("delete from landaccesslist where LandUUID=?LandUUID", m_connection)) | ||
448 | { | ||
449 | cmd.Parameters.Add( | ||
450 | new MySqlParameter("?LandUUID", Util.ToRawUuidString(parcel.landData.globalID))); | ||
451 | cmd.ExecuteNonQuery(); | ||
452 | } | ||
453 | |||
454 | foreach (ParcelManager.ParcelAccessEntry entry in parcel.landData.parcelAccessList) | ||
455 | { | ||
456 | DataRow newAccessRow = landaccesslist.NewRow(); | ||
457 | fillLandAccessRow(newAccessRow, entry, parcel.landData.globalID); | ||
458 | landaccesslist.Rows.Add(newAccessRow); | ||
459 | } | ||
460 | } | ||
461 | Commit(); | ||
462 | break; | ||
463 | } | ||
464 | catch (Exception ex) | ||
448 | { | 465 | { |
449 | DataRow newAccessRow = landaccesslist.NewRow(); | 466 | System.Console.WriteLine("Tedds temp fix exception, will repeat taks: " + ex.ToString()); |
450 | fillLandAccessRow(newAccessRow, entry, parcel.landData.globalID); | 467 | if (loopCount > 3) |
451 | landaccesslist.Rows.Add(newAccessRow); | 468 | throw (ex); |
452 | } | 469 | } |
453 | } | 470 | } |
454 | |||
455 | Commit(); | ||
456 | } | 471 | } |
457 | 472 | ||
458 | public List<LandData> LoadLandObjects(LLUUID regionUUID) | 473 | public List<LandData> LoadLandObjects(LLUUID regionUUID) |
diff --git a/bin/OpenSim.ini.example b/bin/OpenSim.ini.example index 49c93d3..55d261c 100644 --- a/bin/OpenSim.ini.example +++ b/bin/OpenSim.ini.example | |||
@@ -207,7 +207,6 @@ LoadUnloadMaxQueueSize=100 | |||
207 | ; Maximum number of (LSL) events that can be queued before new events are ignored. | 207 | ; Maximum number of (LSL) events that can be queued before new events are ignored. |
208 | EventExecutionMaxQueueSize=300 | 208 | EventExecutionMaxQueueSize=300 |
209 | 209 | ||
210 | |||
211 | ; Async LL command sleep | 210 | ; Async LL command sleep |
212 | ; If no async LL commands are waiting, how long should thread sleep before checking again | 211 | ; If no async LL commands are waiting, how long should thread sleep before checking again |
213 | ; Async LL commands are LSL-commands that causes an event to be fired back with result | 212 | ; Async LL commands are LSL-commands that causes an event to be fired back with result |