From f0896c263bea162a64367e5d3c86daeb7cc91a7b Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Fri, 18 Apr 2008 22:46:03 +0000 Subject: * Insert some missing database locks for inventory and user data on mysql --- OpenSim/Data/MySQL/MySQLInventoryData.cs | 13 +++++++++++-- OpenSim/Data/MySQL/MySQLUserData.cs | 14 +++++++++----- 2 files changed, 20 insertions(+), 7 deletions(-) (limited to 'OpenSim/Data') 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 result.Parameters.AddWithValue("?creatorID", item.Creator.ToString()); result.Parameters.AddWithValue("?inventoryBasePermissions", item.BasePermissions); result.Parameters.AddWithValue("?inventoryEveryOnePermissions", item.EveryOnePermissions); - result.ExecuteNonQuery(); + + lock (database) + { + result.ExecuteNonQuery(); + } + result.Dispose(); } catch (MySqlException e) @@ -487,7 +492,11 @@ namespace OpenSim.Data.MySQL MySqlCommand cmd = new MySqlCommand("DELETE FROM inventoryitems WHERE inventoryID=?uuid", database.Connection); cmd.Parameters.AddWithValue("?uuid", itemID.ToString()); - cmd.ExecuteNonQuery(); + + lock (database) + { + cmd.ExecuteNonQuery(); + } } catch (MySqlException e) { 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 /// The profile data to use to update the DB override public bool UpdateUserProfile(UserProfileData user) { - database.updateUserRow(user.ID, user.FirstName, user.SurName, user.PasswordHash, user.PasswordSalt, - user.HomeRegion, user.HomeLocation.X, user.HomeLocation.Y, user.HomeLocation.Z, user.HomeLookAt.X, - user.HomeLookAt.Y, user.HomeLookAt.Z, user.Created, user.LastLogin, user.UserInventoryURI, - user.UserAssetURI, user.CanDoMask, user.WantDoMask, user.AboutText, - user.FirstLifeAboutText, user.Image, user.FirstLifeImage, user.WebLoginKey); + lock (database) + { + database.updateUserRow(user.ID, user.FirstName, user.SurName, user.PasswordHash, user.PasswordSalt, + user.HomeRegion, user.HomeLocation.X, user.HomeLocation.Y, user.HomeLocation.Z, user.HomeLookAt.X, + user.HomeLookAt.Y, user.HomeLookAt.Z, user.Created, user.LastLogin, user.UserInventoryURI, + user.UserAssetURI, user.CanDoMask, user.WantDoMask, user.AboutText, + user.FirstLifeAboutText, user.Image, user.FirstLifeImage, user.WebLoginKey); + } + return true; } -- cgit v1.1