aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/MySQL
diff options
context:
space:
mode:
authorJustin Clarke Casey2008-04-18 22:46:03 +0000
committerJustin Clarke Casey2008-04-18 22:46:03 +0000
commitf0896c263bea162a64367e5d3c86daeb7cc91a7b (patch)
tree621b07e5f805e316daa5016eda4e9b3d4c0d41e2 /OpenSim/Data/MySQL
parentFrom: Alan M Webb <awebb@vnet.ibm.com> (diff)
downloadopensim-SC-f0896c263bea162a64367e5d3c86daeb7cc91a7b.zip
opensim-SC-f0896c263bea162a64367e5d3c86daeb7cc91a7b.tar.gz
opensim-SC-f0896c263bea162a64367e5d3c86daeb7cc91a7b.tar.bz2
opensim-SC-f0896c263bea162a64367e5d3c86daeb7cc91a7b.tar.xz
* Insert some missing database locks for inventory and user data on mysql
Diffstat (limited to 'OpenSim/Data/MySQL')
-rw-r--r--OpenSim/Data/MySQL/MySQLInventoryData.cs13
-rw-r--r--OpenSim/Data/MySQL/MySQLUserData.cs14
2 files changed, 20 insertions, 7 deletions
diff --git a/OpenSim/Data/MySQL/MySQLInventoryData.cs b/OpenSim/Data/MySQL/MySQLInventoryData.cs
index ce9829a..82bbf4f 100644
--- a/OpenSim/Data/MySQL/MySQLInventoryData.cs
+++ b/OpenSim/Data/MySQL/MySQLInventoryData.cs
@@ -458,7 +458,12 @@ namespace OpenSim.Data.MySQL
458 result.Parameters.AddWithValue("?creatorID", item.Creator.ToString()); 458 result.Parameters.AddWithValue("?creatorID", item.Creator.ToString());
459 result.Parameters.AddWithValue("?inventoryBasePermissions", item.BasePermissions); 459 result.Parameters.AddWithValue("?inventoryBasePermissions", item.BasePermissions);
460 result.Parameters.AddWithValue("?inventoryEveryOnePermissions", item.EveryOnePermissions); 460 result.Parameters.AddWithValue("?inventoryEveryOnePermissions", item.EveryOnePermissions);
461 result.ExecuteNonQuery(); 461
462 lock (database)
463 {
464 result.ExecuteNonQuery();
465 }
466
462 result.Dispose(); 467 result.Dispose();
463 } 468 }
464 catch (MySqlException e) 469 catch (MySqlException e)
@@ -487,7 +492,11 @@ namespace OpenSim.Data.MySQL
487 MySqlCommand cmd = 492 MySqlCommand cmd =
488 new MySqlCommand("DELETE FROM inventoryitems WHERE inventoryID=?uuid", database.Connection); 493 new MySqlCommand("DELETE FROM inventoryitems WHERE inventoryID=?uuid", database.Connection);
489 cmd.Parameters.AddWithValue("?uuid", itemID.ToString()); 494 cmd.Parameters.AddWithValue("?uuid", itemID.ToString());
490 cmd.ExecuteNonQuery(); 495
496 lock (database)
497 {
498 cmd.ExecuteNonQuery();
499 }
491 } 500 }
492 catch (MySqlException e) 501 catch (MySqlException e)
493 { 502 {
diff --git a/OpenSim/Data/MySQL/MySQLUserData.cs b/OpenSim/Data/MySQL/MySQLUserData.cs
index 5b2dc76..d04c932 100644
--- a/OpenSim/Data/MySQL/MySQLUserData.cs
+++ b/OpenSim/Data/MySQL/MySQLUserData.cs
@@ -590,11 +590,15 @@ namespace OpenSim.Data.MySQL
590 /// <param name="user">The profile data to use to update the DB</param> 590 /// <param name="user">The profile data to use to update the DB</param>
591 override public bool UpdateUserProfile(UserProfileData user) 591 override public bool UpdateUserProfile(UserProfileData user)
592 { 592 {
593 database.updateUserRow(user.ID, user.FirstName, user.SurName, user.PasswordHash, user.PasswordSalt, 593 lock (database)
594 user.HomeRegion, user.HomeLocation.X, user.HomeLocation.Y, user.HomeLocation.Z, user.HomeLookAt.X, 594 {
595 user.HomeLookAt.Y, user.HomeLookAt.Z, user.Created, user.LastLogin, user.UserInventoryURI, 595 database.updateUserRow(user.ID, user.FirstName, user.SurName, user.PasswordHash, user.PasswordSalt,
596 user.UserAssetURI, user.CanDoMask, user.WantDoMask, user.AboutText, 596 user.HomeRegion, user.HomeLocation.X, user.HomeLocation.Y, user.HomeLocation.Z, user.HomeLookAt.X,
597 user.FirstLifeAboutText, user.Image, user.FirstLifeImage, user.WebLoginKey); 597 user.HomeLookAt.Y, user.HomeLookAt.Z, user.Created, user.LastLogin, user.UserInventoryURI,
598 user.UserAssetURI, user.CanDoMask, user.WantDoMask, user.AboutText,
599 user.FirstLifeAboutText, user.Image, user.FirstLifeImage, user.WebLoginKey);
600 }
601
598 return true; 602 return true;
599 } 603 }
600 604