* Insert some missing database locks for inventory and user data on mysql

0.6.0-stable
Justin Clarke Casey 2008-04-18 22:46:03 +00:00
parent cd09677469
commit f0896c263b
2 changed files with 20 additions and 7 deletions

View File

@ -458,7 +458,12 @@ namespace OpenSim.Data.MySQL
result.Parameters.AddWithValue("?creatorID", item.Creator.ToString()); result.Parameters.AddWithValue("?creatorID", item.Creator.ToString());
result.Parameters.AddWithValue("?inventoryBasePermissions", item.BasePermissions); result.Parameters.AddWithValue("?inventoryBasePermissions", item.BasePermissions);
result.Parameters.AddWithValue("?inventoryEveryOnePermissions", item.EveryOnePermissions); result.Parameters.AddWithValue("?inventoryEveryOnePermissions", item.EveryOnePermissions);
result.ExecuteNonQuery();
lock (database)
{
result.ExecuteNonQuery();
}
result.Dispose(); result.Dispose();
} }
catch (MySqlException e) catch (MySqlException e)
@ -487,7 +492,11 @@ namespace OpenSim.Data.MySQL
MySqlCommand cmd = MySqlCommand cmd =
new MySqlCommand("DELETE FROM inventoryitems WHERE inventoryID=?uuid", database.Connection); new MySqlCommand("DELETE FROM inventoryitems WHERE inventoryID=?uuid", database.Connection);
cmd.Parameters.AddWithValue("?uuid", itemID.ToString()); cmd.Parameters.AddWithValue("?uuid", itemID.ToString());
cmd.ExecuteNonQuery();
lock (database)
{
cmd.ExecuteNonQuery();
}
} }
catch (MySqlException e) catch (MySqlException e)
{ {

View File

@ -590,11 +590,15 @@ namespace OpenSim.Data.MySQL
/// <param name="user">The profile data to use to update the DB</param> /// <param name="user">The profile data to use to update the DB</param>
override public bool UpdateUserProfile(UserProfileData user) override public bool UpdateUserProfile(UserProfileData user)
{ {
database.updateUserRow(user.ID, user.FirstName, user.SurName, user.PasswordHash, user.PasswordSalt, lock (database)
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, database.updateUserRow(user.ID, user.FirstName, user.SurName, user.PasswordHash, user.PasswordSalt,
user.UserAssetURI, user.CanDoMask, user.WantDoMask, user.AboutText, user.HomeRegion, user.HomeLocation.X, user.HomeLocation.Y, user.HomeLocation.Z, user.HomeLookAt.X,
user.FirstLifeAboutText, user.Image, user.FirstLifeImage, user.WebLoginKey); 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; return true;
} }