Remove parts locking from data classes since these are using a copy of the scene object
parent
166ab59420
commit
692cf3c657
|
@ -89,7 +89,6 @@ namespace OpenSim.Data.MSSQL
|
|||
Dictionary<UUID, SceneObjectGroup> objects = new Dictionary<UUID, SceneObjectGroup>();
|
||||
SceneObjectGroup grp = null;
|
||||
|
||||
|
||||
string sql = "SELECT *, " +
|
||||
"sort = CASE WHEN prims.UUID = prims.SceneGroupID THEN 0 ELSE 1 END " +
|
||||
"FROM prims " +
|
||||
|
@ -232,65 +231,62 @@ namespace OpenSim.Data.MSSQL
|
|||
/// <param name="regionUUID"></param>
|
||||
public void StoreObject(SceneObjectGroup obj, UUID regionUUID)
|
||||
{
|
||||
lock (obj.Children)
|
||||
_Log.DebugFormat("[MSSQL]: Adding/Changing SceneObjectGroup: {0} to region: {1}, object has {2} prims.", obj.UUID, regionUUID, obj.Children.Count);
|
||||
|
||||
using (SqlConnection conn = new SqlConnection(m_connectionString))
|
||||
{
|
||||
_Log.DebugFormat("[MSSQL]: Adding/Changing SceneObjectGroup: {0} to region: {1}, object has {2} prims.", obj.UUID, regionUUID, obj.Children.Count);
|
||||
|
||||
using (SqlConnection conn = new SqlConnection(m_connectionString))
|
||||
conn.Open();
|
||||
SqlTransaction transaction = conn.BeginTransaction();
|
||||
|
||||
try
|
||||
{
|
||||
conn.Open();
|
||||
SqlTransaction transaction = conn.BeginTransaction();
|
||||
|
||||
foreach (SceneObjectPart sceneObjectPart in obj.Children.Values)
|
||||
{
|
||||
//Update prim
|
||||
using (SqlCommand sqlCommand = conn.CreateCommand())
|
||||
{
|
||||
sqlCommand.Transaction = transaction;
|
||||
try
|
||||
{
|
||||
StoreSceneObjectPrim(sceneObjectPart, sqlCommand, obj.UUID, regionUUID);
|
||||
}
|
||||
catch (SqlException sqlEx)
|
||||
{
|
||||
_Log.ErrorFormat("[REGION DB]: Store SceneObjectPrim SQL error: {0} at line {1}", sqlEx.Message, sqlEx.LineNumber);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
//Update primshapes
|
||||
using (SqlCommand sqlCommand = conn.CreateCommand())
|
||||
{
|
||||
sqlCommand.Transaction = transaction;
|
||||
try
|
||||
{
|
||||
StoreSceneObjectPrimShapes(sceneObjectPart, sqlCommand, obj.UUID, regionUUID);
|
||||
}
|
||||
catch (SqlException sqlEx)
|
||||
{
|
||||
_Log.ErrorFormat("[REGION DB]: Store SceneObjectPrimShapes SQL error: {0} at line {1}", sqlEx.Message, sqlEx.LineNumber);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
transaction.Commit();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_Log.ErrorFormat("[REGION DB]: Store SceneObjectGroup error: {0}, Rolling back...", ex.Message);
|
||||
try
|
||||
{
|
||||
foreach (SceneObjectPart sceneObjectPart in obj.Children.Values)
|
||||
{
|
||||
//Update prim
|
||||
using (SqlCommand sqlCommand = conn.CreateCommand())
|
||||
{
|
||||
sqlCommand.Transaction = transaction;
|
||||
try
|
||||
{
|
||||
StoreSceneObjectPrim(sceneObjectPart, sqlCommand, obj.UUID, regionUUID);
|
||||
}
|
||||
catch (SqlException sqlEx)
|
||||
{
|
||||
_Log.ErrorFormat("[REGION DB]: Store SceneObjectPrim SQL error: {0} at line {1}", sqlEx.Message, sqlEx.LineNumber);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
//Update primshapes
|
||||
using (SqlCommand sqlCommand = conn.CreateCommand())
|
||||
{
|
||||
sqlCommand.Transaction = transaction;
|
||||
try
|
||||
{
|
||||
StoreSceneObjectPrimShapes(sceneObjectPart, sqlCommand, obj.UUID, regionUUID);
|
||||
}
|
||||
catch (SqlException sqlEx)
|
||||
{
|
||||
_Log.ErrorFormat("[REGION DB]: Store SceneObjectPrimShapes SQL error: {0} at line {1}", sqlEx.Message, sqlEx.LineNumber);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
transaction.Commit();
|
||||
transaction.Rollback();
|
||||
}
|
||||
catch (Exception ex)
|
||||
catch (Exception ex2)
|
||||
{
|
||||
_Log.ErrorFormat("[REGION DB]: Store SceneObjectGroup error: {0}, Rolling back...", ex.Message);
|
||||
try
|
||||
{
|
||||
transaction.Rollback();
|
||||
}
|
||||
catch (Exception ex2)
|
||||
{
|
||||
//Show error
|
||||
_Log.InfoFormat("[REGION DB]: Rollback of SceneObjectGroup store transaction failed with error: {0}", ex2.Message);
|
||||
|
||||
}
|
||||
//Show error
|
||||
_Log.InfoFormat("[REGION DB]: Rollback of SceneObjectGroup store transaction failed with error: {0}", ex2.Message);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -135,115 +135,112 @@ namespace OpenSim.Data.MySQL
|
|||
dbcon.Open();
|
||||
MySqlCommand cmd = dbcon.CreateCommand();
|
||||
|
||||
lock (obj.Children)
|
||||
foreach (SceneObjectPart prim in obj.Children.Values)
|
||||
{
|
||||
foreach (SceneObjectPart prim in obj.Children.Values)
|
||||
{
|
||||
cmd.Parameters.Clear();
|
||||
|
||||
cmd.CommandText = "replace into prims (" +
|
||||
"UUID, CreationDate, " +
|
||||
"Name, Text, Description, " +
|
||||
"SitName, TouchName, ObjectFlags, " +
|
||||
"OwnerMask, NextOwnerMask, GroupMask, " +
|
||||
"EveryoneMask, BaseMask, PositionX, " +
|
||||
"PositionY, PositionZ, GroupPositionX, " +
|
||||
"GroupPositionY, GroupPositionZ, VelocityX, " +
|
||||
"VelocityY, VelocityZ, AngularVelocityX, " +
|
||||
"AngularVelocityY, AngularVelocityZ, " +
|
||||
"AccelerationX, AccelerationY, " +
|
||||
"AccelerationZ, RotationX, " +
|
||||
"RotationY, RotationZ, " +
|
||||
"RotationW, SitTargetOffsetX, " +
|
||||
"SitTargetOffsetY, SitTargetOffsetZ, " +
|
||||
"SitTargetOrientW, SitTargetOrientX, " +
|
||||
"SitTargetOrientY, SitTargetOrientZ, " +
|
||||
"RegionUUID, CreatorID, " +
|
||||
"OwnerID, GroupID, " +
|
||||
"LastOwnerID, SceneGroupID, " +
|
||||
"PayPrice, PayButton1, " +
|
||||
"PayButton2, PayButton3, " +
|
||||
"PayButton4, LoopedSound, " +
|
||||
"LoopedSoundGain, TextureAnimation, " +
|
||||
"OmegaX, OmegaY, OmegaZ, " +
|
||||
"CameraEyeOffsetX, CameraEyeOffsetY, " +
|
||||
"CameraEyeOffsetZ, CameraAtOffsetX, " +
|
||||
"CameraAtOffsetY, CameraAtOffsetZ, " +
|
||||
"ForceMouselook, ScriptAccessPin, " +
|
||||
"AllowedDrop, DieAtEdge, " +
|
||||
"SalePrice, SaleType, " +
|
||||
"ColorR, ColorG, ColorB, ColorA, " +
|
||||
"ParticleSystem, ClickAction, Material, " +
|
||||
"CollisionSound, CollisionSoundVolume, " +
|
||||
"PassTouches, " +
|
||||
"LinkNumber, MediaURL) values (" + "?UUID, " +
|
||||
"?CreationDate, ?Name, ?Text, " +
|
||||
"?Description, ?SitName, ?TouchName, " +
|
||||
"?ObjectFlags, ?OwnerMask, ?NextOwnerMask, " +
|
||||
"?GroupMask, ?EveryoneMask, ?BaseMask, " +
|
||||
"?PositionX, ?PositionY, ?PositionZ, " +
|
||||
"?GroupPositionX, ?GroupPositionY, " +
|
||||
"?GroupPositionZ, ?VelocityX, " +
|
||||
"?VelocityY, ?VelocityZ, ?AngularVelocityX, " +
|
||||
"?AngularVelocityY, ?AngularVelocityZ, " +
|
||||
"?AccelerationX, ?AccelerationY, " +
|
||||
"?AccelerationZ, ?RotationX, " +
|
||||
"?RotationY, ?RotationZ, " +
|
||||
"?RotationW, ?SitTargetOffsetX, " +
|
||||
"?SitTargetOffsetY, ?SitTargetOffsetZ, " +
|
||||
"?SitTargetOrientW, ?SitTargetOrientX, " +
|
||||
"?SitTargetOrientY, ?SitTargetOrientZ, " +
|
||||
"?RegionUUID, ?CreatorID, ?OwnerID, " +
|
||||
"?GroupID, ?LastOwnerID, ?SceneGroupID, " +
|
||||
"?PayPrice, ?PayButton1, ?PayButton2, " +
|
||||
"?PayButton3, ?PayButton4, ?LoopedSound, " +
|
||||
"?LoopedSoundGain, ?TextureAnimation, " +
|
||||
"?OmegaX, ?OmegaY, ?OmegaZ, " +
|
||||
"?CameraEyeOffsetX, ?CameraEyeOffsetY, " +
|
||||
"?CameraEyeOffsetZ, ?CameraAtOffsetX, " +
|
||||
"?CameraAtOffsetY, ?CameraAtOffsetZ, " +
|
||||
"?ForceMouselook, ?ScriptAccessPin, " +
|
||||
"?AllowedDrop, ?DieAtEdge, ?SalePrice, " +
|
||||
"?SaleType, ?ColorR, ?ColorG, " +
|
||||
"?ColorB, ?ColorA, ?ParticleSystem, " +
|
||||
"?ClickAction, ?Material, ?CollisionSound, " +
|
||||
"?CollisionSoundVolume, ?PassTouches, ?LinkNumber, ?MediaURL)";
|
||||
|
||||
FillPrimCommand(cmd, prim, obj.UUID, regionUUID);
|
||||
|
||||
ExecuteNonQuery(cmd);
|
||||
|
||||
cmd.Parameters.Clear();
|
||||
|
||||
cmd.CommandText = "replace into primshapes (" +
|
||||
"UUID, Shape, ScaleX, ScaleY, " +
|
||||
"ScaleZ, PCode, PathBegin, PathEnd, " +
|
||||
"PathScaleX, PathScaleY, PathShearX, " +
|
||||
"PathShearY, PathSkew, PathCurve, " +
|
||||
"PathRadiusOffset, PathRevolutions, " +
|
||||
"PathTaperX, PathTaperY, PathTwist, " +
|
||||
"PathTwistBegin, ProfileBegin, ProfileEnd, " +
|
||||
"ProfileCurve, ProfileHollow, Texture, " +
|
||||
"ExtraParams, State, Media) values (?UUID, " +
|
||||
"?Shape, ?ScaleX, ?ScaleY, ?ScaleZ, " +
|
||||
"?PCode, ?PathBegin, ?PathEnd, " +
|
||||
"?PathScaleX, ?PathScaleY, " +
|
||||
"?PathShearX, ?PathShearY, " +
|
||||
"?PathSkew, ?PathCurve, ?PathRadiusOffset, " +
|
||||
"?PathRevolutions, ?PathTaperX, " +
|
||||
"?PathTaperY, ?PathTwist, " +
|
||||
"?PathTwistBegin, ?ProfileBegin, " +
|
||||
"?ProfileEnd, ?ProfileCurve, " +
|
||||
"?ProfileHollow, ?Texture, ?ExtraParams, " +
|
||||
"?State, ?Media)";
|
||||
|
||||
FillShapeCommand(cmd, prim);
|
||||
|
||||
ExecuteNonQuery(cmd);
|
||||
}
|
||||
|
||||
cmd.Dispose();
|
||||
cmd.Parameters.Clear();
|
||||
|
||||
cmd.CommandText = "replace into prims (" +
|
||||
"UUID, CreationDate, " +
|
||||
"Name, Text, Description, " +
|
||||
"SitName, TouchName, ObjectFlags, " +
|
||||
"OwnerMask, NextOwnerMask, GroupMask, " +
|
||||
"EveryoneMask, BaseMask, PositionX, " +
|
||||
"PositionY, PositionZ, GroupPositionX, " +
|
||||
"GroupPositionY, GroupPositionZ, VelocityX, " +
|
||||
"VelocityY, VelocityZ, AngularVelocityX, " +
|
||||
"AngularVelocityY, AngularVelocityZ, " +
|
||||
"AccelerationX, AccelerationY, " +
|
||||
"AccelerationZ, RotationX, " +
|
||||
"RotationY, RotationZ, " +
|
||||
"RotationW, SitTargetOffsetX, " +
|
||||
"SitTargetOffsetY, SitTargetOffsetZ, " +
|
||||
"SitTargetOrientW, SitTargetOrientX, " +
|
||||
"SitTargetOrientY, SitTargetOrientZ, " +
|
||||
"RegionUUID, CreatorID, " +
|
||||
"OwnerID, GroupID, " +
|
||||
"LastOwnerID, SceneGroupID, " +
|
||||
"PayPrice, PayButton1, " +
|
||||
"PayButton2, PayButton3, " +
|
||||
"PayButton4, LoopedSound, " +
|
||||
"LoopedSoundGain, TextureAnimation, " +
|
||||
"OmegaX, OmegaY, OmegaZ, " +
|
||||
"CameraEyeOffsetX, CameraEyeOffsetY, " +
|
||||
"CameraEyeOffsetZ, CameraAtOffsetX, " +
|
||||
"CameraAtOffsetY, CameraAtOffsetZ, " +
|
||||
"ForceMouselook, ScriptAccessPin, " +
|
||||
"AllowedDrop, DieAtEdge, " +
|
||||
"SalePrice, SaleType, " +
|
||||
"ColorR, ColorG, ColorB, ColorA, " +
|
||||
"ParticleSystem, ClickAction, Material, " +
|
||||
"CollisionSound, CollisionSoundVolume, " +
|
||||
"PassTouches, " +
|
||||
"LinkNumber, MediaURL) values (" + "?UUID, " +
|
||||
"?CreationDate, ?Name, ?Text, " +
|
||||
"?Description, ?SitName, ?TouchName, " +
|
||||
"?ObjectFlags, ?OwnerMask, ?NextOwnerMask, " +
|
||||
"?GroupMask, ?EveryoneMask, ?BaseMask, " +
|
||||
"?PositionX, ?PositionY, ?PositionZ, " +
|
||||
"?GroupPositionX, ?GroupPositionY, " +
|
||||
"?GroupPositionZ, ?VelocityX, " +
|
||||
"?VelocityY, ?VelocityZ, ?AngularVelocityX, " +
|
||||
"?AngularVelocityY, ?AngularVelocityZ, " +
|
||||
"?AccelerationX, ?AccelerationY, " +
|
||||
"?AccelerationZ, ?RotationX, " +
|
||||
"?RotationY, ?RotationZ, " +
|
||||
"?RotationW, ?SitTargetOffsetX, " +
|
||||
"?SitTargetOffsetY, ?SitTargetOffsetZ, " +
|
||||
"?SitTargetOrientW, ?SitTargetOrientX, " +
|
||||
"?SitTargetOrientY, ?SitTargetOrientZ, " +
|
||||
"?RegionUUID, ?CreatorID, ?OwnerID, " +
|
||||
"?GroupID, ?LastOwnerID, ?SceneGroupID, " +
|
||||
"?PayPrice, ?PayButton1, ?PayButton2, " +
|
||||
"?PayButton3, ?PayButton4, ?LoopedSound, " +
|
||||
"?LoopedSoundGain, ?TextureAnimation, " +
|
||||
"?OmegaX, ?OmegaY, ?OmegaZ, " +
|
||||
"?CameraEyeOffsetX, ?CameraEyeOffsetY, " +
|
||||
"?CameraEyeOffsetZ, ?CameraAtOffsetX, " +
|
||||
"?CameraAtOffsetY, ?CameraAtOffsetZ, " +
|
||||
"?ForceMouselook, ?ScriptAccessPin, " +
|
||||
"?AllowedDrop, ?DieAtEdge, ?SalePrice, " +
|
||||
"?SaleType, ?ColorR, ?ColorG, " +
|
||||
"?ColorB, ?ColorA, ?ParticleSystem, " +
|
||||
"?ClickAction, ?Material, ?CollisionSound, " +
|
||||
"?CollisionSoundVolume, ?PassTouches, ?LinkNumber, ?MediaURL)";
|
||||
|
||||
FillPrimCommand(cmd, prim, obj.UUID, regionUUID);
|
||||
|
||||
ExecuteNonQuery(cmd);
|
||||
|
||||
cmd.Parameters.Clear();
|
||||
|
||||
cmd.CommandText = "replace into primshapes (" +
|
||||
"UUID, Shape, ScaleX, ScaleY, " +
|
||||
"ScaleZ, PCode, PathBegin, PathEnd, " +
|
||||
"PathScaleX, PathScaleY, PathShearX, " +
|
||||
"PathShearY, PathSkew, PathCurve, " +
|
||||
"PathRadiusOffset, PathRevolutions, " +
|
||||
"PathTaperX, PathTaperY, PathTwist, " +
|
||||
"PathTwistBegin, ProfileBegin, ProfileEnd, " +
|
||||
"ProfileCurve, ProfileHollow, Texture, " +
|
||||
"ExtraParams, State, Media) values (?UUID, " +
|
||||
"?Shape, ?ScaleX, ?ScaleY, ?ScaleZ, " +
|
||||
"?PCode, ?PathBegin, ?PathEnd, " +
|
||||
"?PathScaleX, ?PathScaleY, " +
|
||||
"?PathShearX, ?PathShearY, " +
|
||||
"?PathSkew, ?PathCurve, ?PathRadiusOffset, " +
|
||||
"?PathRevolutions, ?PathTaperX, " +
|
||||
"?PathTaperY, ?PathTwist, " +
|
||||
"?PathTwistBegin, ?ProfileBegin, " +
|
||||
"?ProfileEnd, ?ProfileCurve, " +
|
||||
"?ProfileHollow, ?Texture, ?ExtraParams, " +
|
||||
"?State, ?Media)";
|
||||
|
||||
FillShapeCommand(cmd, prim);
|
||||
|
||||
ExecuteNonQuery(cmd);
|
||||
}
|
||||
|
||||
cmd.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -360,13 +360,10 @@ namespace OpenSim.Data.SQLite
|
|||
|
||||
lock (ds)
|
||||
{
|
||||
lock (obj.Children)
|
||||
foreach (SceneObjectPart prim in obj.Children.Values)
|
||||
{
|
||||
foreach (SceneObjectPart prim in obj.Children.Values)
|
||||
{
|
||||
// m_log.Info("[REGION DB]: Adding obj: " + obj.UUID + " to region: " + regionUUID);
|
||||
addPrim(prim, obj.UUID, regionUUID);
|
||||
}
|
||||
// m_log.Info("[REGION DB]: Adding obj: " + obj.UUID + " to region: " + regionUUID);
|
||||
addPrim(prim, obj.UUID, regionUUID);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -327,13 +327,10 @@ namespace OpenSim.Data.SQLiteLegacy
|
|||
|
||||
lock (ds)
|
||||
{
|
||||
lock (obj.Children)
|
||||
foreach (SceneObjectPart prim in obj.Children.Values)
|
||||
{
|
||||
foreach (SceneObjectPart prim in obj.Children.Values)
|
||||
{
|
||||
// m_log.Info("[REGION DB]: Adding obj: " + obj.UUID + " to region: " + regionUUID);
|
||||
addPrim(prim, obj.UUID, regionUUID);
|
||||
}
|
||||
// m_log.Info("[REGION DB]: Adding obj: " + obj.UUID + " to region: " + regionUUID);
|
||||
addPrim(prim, obj.UUID, regionUUID);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue