diff options
Diffstat (limited to 'OpenSim/Data/MySQL/MySQLInventoryData.cs')
-rw-r--r-- | OpenSim/Data/MySQL/MySQLInventoryData.cs | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/OpenSim/Data/MySQL/MySQLInventoryData.cs b/OpenSim/Data/MySQL/MySQLInventoryData.cs index e9b10f3..cc787cc 100644 --- a/OpenSim/Data/MySQL/MySQLInventoryData.cs +++ b/OpenSim/Data/MySQL/MySQLInventoryData.cs | |||
@@ -78,6 +78,7 @@ namespace OpenSim.Data.MySQL | |||
78 | dbcon.Open(); | 78 | dbcon.Open(); |
79 | Migration m = new Migration(dbcon, assem, "InventoryStore"); | 79 | Migration m = new Migration(dbcon, assem, "InventoryStore"); |
80 | m.Update(); | 80 | m.Update(); |
81 | dbcon.Close(); | ||
81 | } | 82 | } |
82 | } | 83 | } |
83 | 84 | ||
@@ -130,6 +131,7 @@ namespace OpenSim.Data.MySQL | |||
130 | items.Add(item); | 131 | items.Add(item); |
131 | } | 132 | } |
132 | 133 | ||
134 | dbcon.Close(); | ||
133 | return items; | 135 | return items; |
134 | } | 136 | } |
135 | } | 137 | } |
@@ -170,6 +172,7 @@ namespace OpenSim.Data.MySQL | |||
170 | while (reader.Read()) | 172 | while (reader.Read()) |
171 | items.Add(readInventoryFolder(reader)); | 173 | items.Add(readInventoryFolder(reader)); |
172 | 174 | ||
175 | dbcon.Close(); | ||
173 | return items; | 176 | return items; |
174 | } | 177 | } |
175 | } | 178 | } |
@@ -221,6 +224,7 @@ namespace OpenSim.Data.MySQL | |||
221 | if (items.Count > 0) | 224 | if (items.Count > 0) |
222 | rootFolder = items[0]; | 225 | rootFolder = items[0]; |
223 | 226 | ||
227 | dbcon.Close(); | ||
224 | return rootFolder; | 228 | return rootFolder; |
225 | } | 229 | } |
226 | } | 230 | } |
@@ -261,6 +265,7 @@ namespace OpenSim.Data.MySQL | |||
261 | while (reader.Read()) | 265 | while (reader.Read()) |
262 | items.Add(readInventoryFolder(reader)); | 266 | items.Add(readInventoryFolder(reader)); |
263 | 267 | ||
268 | dbcon.Close(); | ||
264 | return items; | 269 | return items; |
265 | } | 270 | } |
266 | } | 271 | } |
@@ -288,7 +293,7 @@ namespace OpenSim.Data.MySQL | |||
288 | // TODO: this is to handle a case where NULLs creep in there, which we are not sure is endemic to the system, or legacy. It would be nice to live fix these. | 293 | // TODO: this is to handle a case where NULLs creep in there, which we are not sure is endemic to the system, or legacy. It would be nice to live fix these. |
289 | // (DBGuid.FromDB() reads db NULLs as well, returns UUID.Zero) | 294 | // (DBGuid.FromDB() reads db NULLs as well, returns UUID.Zero) |
290 | item.CreatorId = reader["creatorID"].ToString(); | 295 | item.CreatorId = reader["creatorID"].ToString(); |
291 | 296 | ||
292 | // Be a bit safer in parsing these because the | 297 | // Be a bit safer in parsing these because the |
293 | // database doesn't enforce them to be not null, and | 298 | // database doesn't enforce them to be not null, and |
294 | // the inventory still works if these are weird in the | 299 | // the inventory still works if these are weird in the |
@@ -352,6 +357,7 @@ namespace OpenSim.Data.MySQL | |||
352 | if (reader.Read()) | 357 | if (reader.Read()) |
353 | item = readInventoryItem(reader); | 358 | item = readInventoryItem(reader); |
354 | 359 | ||
360 | dbcon.Close(); | ||
355 | return item; | 361 | return item; |
356 | } | 362 | } |
357 | } | 363 | } |
@@ -417,6 +423,7 @@ namespace OpenSim.Data.MySQL | |||
417 | if (reader.Read()) | 423 | if (reader.Read()) |
418 | folder = readInventoryFolder(reader); | 424 | folder = readInventoryFolder(reader); |
419 | 425 | ||
426 | dbcon.Close(); | ||
420 | return folder; | 427 | return folder; |
421 | } | 428 | } |
422 | } | 429 | } |
@@ -453,7 +460,7 @@ namespace OpenSim.Data.MySQL | |||
453 | itemName = item.Name.Substring(0, 64); | 460 | itemName = item.Name.Substring(0, 64); |
454 | m_log.Warn("[INVENTORY DB]: Name field truncated from " + item.Name.Length + " to " + itemName.Length + " characters on add item"); | 461 | m_log.Warn("[INVENTORY DB]: Name field truncated from " + item.Name.Length + " to " + itemName.Length + " characters on add item"); |
455 | } | 462 | } |
456 | 463 | ||
457 | string itemDesc = item.Description; | 464 | string itemDesc = item.Description; |
458 | if (item.Description.Length > 128) | 465 | if (item.Description.Length > 128) |
459 | { | 466 | { |
@@ -490,10 +497,10 @@ namespace OpenSim.Data.MySQL | |||
490 | result.Parameters.AddWithValue("?groupID", item.GroupID); | 497 | result.Parameters.AddWithValue("?groupID", item.GroupID); |
491 | result.Parameters.AddWithValue("?groupOwned", item.GroupOwned); | 498 | result.Parameters.AddWithValue("?groupOwned", item.GroupOwned); |
492 | result.Parameters.AddWithValue("?flags", item.Flags); | 499 | result.Parameters.AddWithValue("?flags", item.Flags); |
493 | 500 | ||
494 | lock (m_dbLock) | 501 | lock (m_dbLock) |
495 | result.ExecuteNonQuery(); | 502 | result.ExecuteNonQuery(); |
496 | 503 | ||
497 | result.Dispose(); | 504 | result.Dispose(); |
498 | } | 505 | } |
499 | 506 | ||
@@ -504,6 +511,7 @@ namespace OpenSim.Data.MySQL | |||
504 | lock (m_dbLock) | 511 | lock (m_dbLock) |
505 | result.ExecuteNonQuery(); | 512 | result.ExecuteNonQuery(); |
506 | } | 513 | } |
514 | dbcon.Close(); | ||
507 | } | 515 | } |
508 | } | 516 | } |
509 | catch (MySqlException e) | 517 | catch (MySqlException e) |
@@ -540,6 +548,7 @@ namespace OpenSim.Data.MySQL | |||
540 | lock (m_dbLock) | 548 | lock (m_dbLock) |
541 | cmd.ExecuteNonQuery(); | 549 | cmd.ExecuteNonQuery(); |
542 | } | 550 | } |
551 | dbcon.Close(); | ||
543 | } | 552 | } |
544 | } | 553 | } |
545 | catch (MySqlException e) | 554 | catch (MySqlException e) |
@@ -600,6 +609,7 @@ namespace OpenSim.Data.MySQL | |||
600 | m_log.Error(e.ToString()); | 609 | m_log.Error(e.ToString()); |
601 | } | 610 | } |
602 | } | 611 | } |
612 | dbcon.Close(); | ||
603 | } | 613 | } |
604 | } | 614 | } |
605 | 615 | ||
@@ -630,7 +640,7 @@ namespace OpenSim.Data.MySQL | |||
630 | { | 640 | { |
631 | cmd.Parameters.AddWithValue("?folderID", folder.ID.ToString()); | 641 | cmd.Parameters.AddWithValue("?folderID", folder.ID.ToString()); |
632 | cmd.Parameters.AddWithValue("?parentFolderID", folder.ParentID.ToString()); | 642 | cmd.Parameters.AddWithValue("?parentFolderID", folder.ParentID.ToString()); |
633 | 643 | ||
634 | try | 644 | try |
635 | { | 645 | { |
636 | lock (m_dbLock) | 646 | lock (m_dbLock) |
@@ -643,6 +653,7 @@ namespace OpenSim.Data.MySQL | |||
643 | m_log.Error(e.ToString()); | 653 | m_log.Error(e.ToString()); |
644 | } | 654 | } |
645 | } | 655 | } |
656 | dbcon.Close(); | ||
646 | } | 657 | } |
647 | } | 658 | } |
648 | 659 | ||
@@ -806,6 +817,7 @@ namespace OpenSim.Data.MySQL | |||
806 | lock (m_dbLock) | 817 | lock (m_dbLock) |
807 | cmd.ExecuteNonQuery(); | 818 | cmd.ExecuteNonQuery(); |
808 | } | 819 | } |
820 | dbcon.Close(); | ||
809 | } | 821 | } |
810 | } | 822 | } |
811 | catch (MySqlException e) | 823 | catch (MySqlException e) |
@@ -833,6 +845,7 @@ namespace OpenSim.Data.MySQL | |||
833 | lock (m_dbLock) | 845 | lock (m_dbLock) |
834 | cmd.ExecuteNonQuery(); | 846 | cmd.ExecuteNonQuery(); |
835 | } | 847 | } |
848 | dbcon.Close(); | ||
836 | } | 849 | } |
837 | } | 850 | } |
838 | catch (MySqlException e) | 851 | catch (MySqlException e) |
@@ -860,7 +873,7 @@ namespace OpenSim.Data.MySQL | |||
860 | deleteOneFolder(folderID); | 873 | deleteOneFolder(folderID); |
861 | deleteItemsInFolder(folderID); | 874 | deleteItemsInFolder(folderID); |
862 | } | 875 | } |
863 | 876 | ||
864 | public List<InventoryItemBase> fetchActiveGestures(UUID avatarID) | 877 | public List<InventoryItemBase> fetchActiveGestures(UUID avatarID) |
865 | { | 878 | { |
866 | lock (m_dbLock) | 879 | lock (m_dbLock) |
@@ -886,6 +899,7 @@ namespace OpenSim.Data.MySQL | |||
886 | if (item != null) | 899 | if (item != null) |
887 | list.Add(item); | 900 | list.Add(item); |
888 | } | 901 | } |
902 | dbcon.Close(); | ||
889 | return list; | 903 | return list; |
890 | } | 904 | } |
891 | } | 905 | } |