diff --git a/OpenSim/Data/MySQL/MySQLInventoryData.cs b/OpenSim/Data/MySQL/MySQLInventoryData.cs index ce9829a5f9..82bbf4ffa9 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 5b2dc76e4b..d04c9320d7 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; }