diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Framework/Data.MySQL/MySQLDataStore.cs | 71 |
1 files changed, 43 insertions, 28 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) |