From 8031f8ec09df4f654c86a9c7bc498664f7b9d9dc Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Thu, 26 Aug 2010 00:08:53 +0100
Subject: Improve consistency of locking for SOG.m_parts in order to avoid race
conditions in linking and unlinking
---
OpenSim/Data/MSSQL/MSSQLLegacyRegionData.cs | 94 ++++++------
OpenSim/Data/MySQL/MySQLLegacyRegionData.cs | 210 +++++++++++++-------------
OpenSim/Data/SQLite/SQLiteRegionData.cs | 9 +-
OpenSim/Data/SQLiteLegacy/SQLiteRegionData.cs | 9 +-
4 files changed, 167 insertions(+), 155 deletions(-)
(limited to 'OpenSim/Data')
diff --git a/OpenSim/Data/MSSQL/MSSQLLegacyRegionData.cs b/OpenSim/Data/MSSQL/MSSQLLegacyRegionData.cs
index 7d017a6..4ce93e5 100644
--- a/OpenSim/Data/MSSQL/MSSQLLegacyRegionData.cs
+++ b/OpenSim/Data/MSSQL/MSSQLLegacyRegionData.cs
@@ -232,66 +232,68 @@ namespace OpenSim.Data.MSSQL
///
public void StoreObject(SceneObjectGroup obj, UUID regionUUID)
{
- _Log.InfoFormat("[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))
+ lock (obj.Children)
{
- conn.Open();
- SqlTransaction transaction = conn.BeginTransaction();
-
- try
+ _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))
{
- foreach (SceneObjectPart sceneObjectPart in obj.Children.Values)
+ conn.Open();
+ SqlTransaction transaction = conn.BeginTransaction();
+
+ try
{
- //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())
+ foreach (SceneObjectPart sceneObjectPart in obj.Children.Values)
{
- sqlCommand.Transaction = transaction;
- try
+ //Update prim
+ using (SqlCommand sqlCommand = conn.CreateCommand())
{
- StoreSceneObjectPrimShapes(sceneObjectPart, sqlCommand, obj.UUID, regionUUID);
+ 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;
+ }
}
- catch (SqlException sqlEx)
+
+ //Update primshapes
+ using (SqlCommand sqlCommand = conn.CreateCommand())
{
- _Log.ErrorFormat("[REGION DB]: Store SceneObjectPrimShapes SQL error: {0} at line {1}", sqlEx.Message, sqlEx.LineNumber);
- throw;
+ 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.Commit();
- }
- catch (Exception ex)
- {
- _Log.ErrorFormat("[REGION DB]: Store SceneObjectGroup error: {0}, Rolling back...", ex.Message);
- try
- {
- transaction.Rollback();
- }
- catch (Exception ex2)
+ catch (Exception ex)
{
- //Show error
- _Log.InfoFormat("[REGION DB]: Rollback of SceneObjectGroup store transaction failed with error: {0}", ex2.Message);
-
+ _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);
+
+ }
}
}
}
-
}
///
diff --git a/OpenSim/Data/MySQL/MySQLLegacyRegionData.cs b/OpenSim/Data/MySQL/MySQLLegacyRegionData.cs
index 1edcb5d..b756b4f 100644
--- a/OpenSim/Data/MySQL/MySQLLegacyRegionData.cs
+++ b/OpenSim/Data/MySQL/MySQLLegacyRegionData.cs
@@ -135,111 +135,115 @@ namespace OpenSim.Data.MySQL
dbcon.Open();
MySqlCommand cmd = dbcon.CreateCommand();
- foreach (SceneObjectPart prim in obj.Children.Values)
+ lock (obj.Children)
{
- 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);
+ 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.Dispose();
}
}
}
diff --git a/OpenSim/Data/SQLite/SQLiteRegionData.cs b/OpenSim/Data/SQLite/SQLiteRegionData.cs
index 4208050..bfd8279 100644
--- a/OpenSim/Data/SQLite/SQLiteRegionData.cs
+++ b/OpenSim/Data/SQLite/SQLiteRegionData.cs
@@ -360,10 +360,13 @@ namespace OpenSim.Data.SQLite
lock (ds)
{
- foreach (SceneObjectPart prim in obj.Children.Values)
+ lock (obj.Children)
{
-// m_log.Info("[REGION DB]: Adding obj: " + obj.UUID + " to region: " + regionUUID);
- addPrim(prim, obj.UUID, regionUUID);
+ foreach (SceneObjectPart prim in obj.Children.Values)
+ {
+ // m_log.Info("[REGION DB]: Adding obj: " + obj.UUID + " to region: " + regionUUID);
+ addPrim(prim, obj.UUID, regionUUID);
+ }
}
}
diff --git a/OpenSim/Data/SQLiteLegacy/SQLiteRegionData.cs b/OpenSim/Data/SQLiteLegacy/SQLiteRegionData.cs
index 289fd94..779b2ed 100644
--- a/OpenSim/Data/SQLiteLegacy/SQLiteRegionData.cs
+++ b/OpenSim/Data/SQLiteLegacy/SQLiteRegionData.cs
@@ -327,10 +327,13 @@ namespace OpenSim.Data.SQLiteLegacy
lock (ds)
{
- foreach (SceneObjectPart prim in obj.Children.Values)
+ lock (obj.Children)
{
-// m_log.Info("[REGION DB]: Adding obj: " + obj.UUID + " to region: " + regionUUID);
- addPrim(prim, obj.UUID, regionUUID);
+ foreach (SceneObjectPart prim in obj.Children.Values)
+ {
+ // m_log.Info("[REGION DB]: Adding obj: " + obj.UUID + " to region: " + regionUUID);
+ addPrim(prim, obj.UUID, regionUUID);
+ }
}
}
--
cgit v1.1
From 692cf3c657aaa74645722491c997f23b4d6f8f76 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Thu, 26 Aug 2010 00:17:26 +0100
Subject: Remove parts locking from data classes since these are using a copy
of the scene object
---
OpenSim/Data/MSSQL/MSSQLLegacyRegionData.cs | 94 ++++++------
OpenSim/Data/MySQL/MySQLLegacyRegionData.cs | 211 +++++++++++++-------------
OpenSim/Data/SQLite/SQLiteRegionData.cs | 9 +-
OpenSim/Data/SQLiteLegacy/SQLiteRegionData.cs | 9 +-
4 files changed, 155 insertions(+), 168 deletions(-)
(limited to 'OpenSim/Data')
diff --git a/OpenSim/Data/MSSQL/MSSQLLegacyRegionData.cs b/OpenSim/Data/MSSQL/MSSQLLegacyRegionData.cs
index 4ce93e5..7ff8737 100644
--- a/OpenSim/Data/MSSQL/MSSQLLegacyRegionData.cs
+++ b/OpenSim/Data/MSSQL/MSSQLLegacyRegionData.cs
@@ -89,7 +89,6 @@ namespace OpenSim.Data.MSSQL
Dictionary objects = new Dictionary();
SceneObjectGroup grp = null;
-
string sql = "SELECT *, " +
"sort = CASE WHEN prims.UUID = prims.SceneGroupID THEN 0 ELSE 1 END " +
"FROM prims " +
@@ -232,66 +231,63 @@ namespace OpenSim.Data.MSSQL
///
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();
-
- try
+ foreach (SceneObjectPart sceneObjectPart in obj.Children.Values)
{
- foreach (SceneObjectPart sceneObjectPart in obj.Children.Values)
+ //Update prim
+ using (SqlCommand sqlCommand = conn.CreateCommand())
{
- //Update prim
- using (SqlCommand sqlCommand = conn.CreateCommand())
+ sqlCommand.Transaction = transaction;
+ try
{
- 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;
- }
+ StoreSceneObjectPrim(sceneObjectPart, sqlCommand, obj.UUID, regionUUID);
}
-
- //Update primshapes
- using (SqlCommand sqlCommand = conn.CreateCommand())
+ catch (SqlException sqlEx)
{
- 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;
- }
+ _Log.ErrorFormat("[REGION DB]: Store SceneObjectPrim 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
- {
- transaction.Rollback();
- }
- catch (Exception ex2)
+
+ //Update primshapes
+ using (SqlCommand sqlCommand = conn.CreateCommand())
{
- //Show error
- _Log.InfoFormat("[REGION DB]: Rollback of SceneObjectGroup store transaction failed with error: {0}", ex2.Message);
-
+ 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
+ {
+ transaction.Rollback();
+ }
+ catch (Exception ex2)
+ {
+ //Show error
+ _Log.InfoFormat("[REGION DB]: Rollback of SceneObjectGroup store transaction failed with error: {0}", ex2.Message);
+
+ }
}
}
}
diff --git a/OpenSim/Data/MySQL/MySQLLegacyRegionData.cs b/OpenSim/Data/MySQL/MySQLLegacyRegionData.cs
index b756b4f..37d7a88 100644
--- a/OpenSim/Data/MySQL/MySQLLegacyRegionData.cs
+++ b/OpenSim/Data/MySQL/MySQLLegacyRegionData.cs
@@ -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();
}
}
}
diff --git a/OpenSim/Data/SQLite/SQLiteRegionData.cs b/OpenSim/Data/SQLite/SQLiteRegionData.cs
index bfd8279..4208050 100644
--- a/OpenSim/Data/SQLite/SQLiteRegionData.cs
+++ b/OpenSim/Data/SQLite/SQLiteRegionData.cs
@@ -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);
}
}
diff --git a/OpenSim/Data/SQLiteLegacy/SQLiteRegionData.cs b/OpenSim/Data/SQLiteLegacy/SQLiteRegionData.cs
index 779b2ed..289fd94 100644
--- a/OpenSim/Data/SQLiteLegacy/SQLiteRegionData.cs
+++ b/OpenSim/Data/SQLiteLegacy/SQLiteRegionData.cs
@@ -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);
}
}
--
cgit v1.1