aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/MySQL
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2010-08-26 00:08:53 +0100
committerJustin Clark-Casey (justincc)2010-08-26 00:08:53 +0100
commit8031f8ec09df4f654c86a9c7bc498664f7b9d9dc (patch)
treed6a6da4d448b9bc11ff8d1078b9be089b9872151 /OpenSim/Data/MySQL
parentminor: remove mono compiler warning (diff)
downloadopensim-SC_OLD-8031f8ec09df4f654c86a9c7bc498664f7b9d9dc.zip
opensim-SC_OLD-8031f8ec09df4f654c86a9c7bc498664f7b9d9dc.tar.gz
opensim-SC_OLD-8031f8ec09df4f654c86a9c7bc498664f7b9d9dc.tar.bz2
opensim-SC_OLD-8031f8ec09df4f654c86a9c7bc498664f7b9d9dc.tar.xz
Improve consistency of locking for SOG.m_parts in order to avoid race conditions in linking and unlinking
Diffstat (limited to '')
-rw-r--r--OpenSim/Data/MySQL/MySQLLegacyRegionData.cs210
1 files changed, 107 insertions, 103 deletions
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
135 dbcon.Open(); 135 dbcon.Open();
136 MySqlCommand cmd = dbcon.CreateCommand(); 136 MySqlCommand cmd = dbcon.CreateCommand();
137 137
138 foreach (SceneObjectPart prim in obj.Children.Values) 138 lock (obj.Children)
139 { 139 {
140 cmd.Parameters.Clear(); 140 foreach (SceneObjectPart prim in obj.Children.Values)
141 141 {
142 cmd.CommandText = "replace into prims (" + 142 cmd.Parameters.Clear();
143 "UUID, CreationDate, " + 143
144 "Name, Text, Description, " + 144 cmd.CommandText = "replace into prims (" +
145 "SitName, TouchName, ObjectFlags, " + 145 "UUID, CreationDate, " +
146 "OwnerMask, NextOwnerMask, GroupMask, " + 146 "Name, Text, Description, " +
147 "EveryoneMask, BaseMask, PositionX, " + 147 "SitName, TouchName, ObjectFlags, " +
148 "PositionY, PositionZ, GroupPositionX, " + 148 "OwnerMask, NextOwnerMask, GroupMask, " +
149 "GroupPositionY, GroupPositionZ, VelocityX, " + 149 "EveryoneMask, BaseMask, PositionX, " +
150 "VelocityY, VelocityZ, AngularVelocityX, " + 150 "PositionY, PositionZ, GroupPositionX, " +
151 "AngularVelocityY, AngularVelocityZ, " + 151 "GroupPositionY, GroupPositionZ, VelocityX, " +
152 "AccelerationX, AccelerationY, " + 152 "VelocityY, VelocityZ, AngularVelocityX, " +
153 "AccelerationZ, RotationX, " + 153 "AngularVelocityY, AngularVelocityZ, " +
154 "RotationY, RotationZ, " + 154 "AccelerationX, AccelerationY, " +
155 "RotationW, SitTargetOffsetX, " + 155 "AccelerationZ, RotationX, " +
156 "SitTargetOffsetY, SitTargetOffsetZ, " + 156 "RotationY, RotationZ, " +
157 "SitTargetOrientW, SitTargetOrientX, " + 157 "RotationW, SitTargetOffsetX, " +
158 "SitTargetOrientY, SitTargetOrientZ, " + 158 "SitTargetOffsetY, SitTargetOffsetZ, " +
159 "RegionUUID, CreatorID, " + 159 "SitTargetOrientW, SitTargetOrientX, " +
160 "OwnerID, GroupID, " + 160 "SitTargetOrientY, SitTargetOrientZ, " +
161 "LastOwnerID, SceneGroupID, " + 161 "RegionUUID, CreatorID, " +
162 "PayPrice, PayButton1, " + 162 "OwnerID, GroupID, " +
163 "PayButton2, PayButton3, " + 163 "LastOwnerID, SceneGroupID, " +
164 "PayButton4, LoopedSound, " + 164 "PayPrice, PayButton1, " +
165 "LoopedSoundGain, TextureAnimation, " + 165 "PayButton2, PayButton3, " +
166 "OmegaX, OmegaY, OmegaZ, " + 166 "PayButton4, LoopedSound, " +
167 "CameraEyeOffsetX, CameraEyeOffsetY, " + 167 "LoopedSoundGain, TextureAnimation, " +
168 "CameraEyeOffsetZ, CameraAtOffsetX, " + 168 "OmegaX, OmegaY, OmegaZ, " +
169 "CameraAtOffsetY, CameraAtOffsetZ, " + 169 "CameraEyeOffsetX, CameraEyeOffsetY, " +
170 "ForceMouselook, ScriptAccessPin, " + 170 "CameraEyeOffsetZ, CameraAtOffsetX, " +
171 "AllowedDrop, DieAtEdge, " + 171 "CameraAtOffsetY, CameraAtOffsetZ, " +
172 "SalePrice, SaleType, " + 172 "ForceMouselook, ScriptAccessPin, " +
173 "ColorR, ColorG, ColorB, ColorA, " + 173 "AllowedDrop, DieAtEdge, " +
174 "ParticleSystem, ClickAction, Material, " + 174 "SalePrice, SaleType, " +
175 "CollisionSound, CollisionSoundVolume, " + 175 "ColorR, ColorG, ColorB, ColorA, " +
176 "PassTouches, " + 176 "ParticleSystem, ClickAction, Material, " +
177 "LinkNumber, MediaURL) values (" + "?UUID, " + 177 "CollisionSound, CollisionSoundVolume, " +
178 "?CreationDate, ?Name, ?Text, " + 178 "PassTouches, " +
179 "?Description, ?SitName, ?TouchName, " + 179 "LinkNumber, MediaURL) values (" + "?UUID, " +
180 "?ObjectFlags, ?OwnerMask, ?NextOwnerMask, " + 180 "?CreationDate, ?Name, ?Text, " +
181 "?GroupMask, ?EveryoneMask, ?BaseMask, " + 181 "?Description, ?SitName, ?TouchName, " +
182 "?PositionX, ?PositionY, ?PositionZ, " + 182 "?ObjectFlags, ?OwnerMask, ?NextOwnerMask, " +
183 "?GroupPositionX, ?GroupPositionY, " + 183 "?GroupMask, ?EveryoneMask, ?BaseMask, " +
184 "?GroupPositionZ, ?VelocityX, " + 184 "?PositionX, ?PositionY, ?PositionZ, " +
185 "?VelocityY, ?VelocityZ, ?AngularVelocityX, " + 185 "?GroupPositionX, ?GroupPositionY, " +
186 "?AngularVelocityY, ?AngularVelocityZ, " + 186 "?GroupPositionZ, ?VelocityX, " +
187 "?AccelerationX, ?AccelerationY, " + 187 "?VelocityY, ?VelocityZ, ?AngularVelocityX, " +
188 "?AccelerationZ, ?RotationX, " + 188 "?AngularVelocityY, ?AngularVelocityZ, " +
189 "?RotationY, ?RotationZ, " + 189 "?AccelerationX, ?AccelerationY, " +
190 "?RotationW, ?SitTargetOffsetX, " + 190 "?AccelerationZ, ?RotationX, " +
191 "?SitTargetOffsetY, ?SitTargetOffsetZ, " + 191 "?RotationY, ?RotationZ, " +
192 "?SitTargetOrientW, ?SitTargetOrientX, " + 192 "?RotationW, ?SitTargetOffsetX, " +
193 "?SitTargetOrientY, ?SitTargetOrientZ, " + 193 "?SitTargetOffsetY, ?SitTargetOffsetZ, " +
194 "?RegionUUID, ?CreatorID, ?OwnerID, " + 194 "?SitTargetOrientW, ?SitTargetOrientX, " +
195 "?GroupID, ?LastOwnerID, ?SceneGroupID, " + 195 "?SitTargetOrientY, ?SitTargetOrientZ, " +
196 "?PayPrice, ?PayButton1, ?PayButton2, " + 196 "?RegionUUID, ?CreatorID, ?OwnerID, " +
197 "?PayButton3, ?PayButton4, ?LoopedSound, " + 197 "?GroupID, ?LastOwnerID, ?SceneGroupID, " +
198 "?LoopedSoundGain, ?TextureAnimation, " + 198 "?PayPrice, ?PayButton1, ?PayButton2, " +
199 "?OmegaX, ?OmegaY, ?OmegaZ, " + 199 "?PayButton3, ?PayButton4, ?LoopedSound, " +
200 "?CameraEyeOffsetX, ?CameraEyeOffsetY, " + 200 "?LoopedSoundGain, ?TextureAnimation, " +
201 "?CameraEyeOffsetZ, ?CameraAtOffsetX, " + 201 "?OmegaX, ?OmegaY, ?OmegaZ, " +
202 "?CameraAtOffsetY, ?CameraAtOffsetZ, " + 202 "?CameraEyeOffsetX, ?CameraEyeOffsetY, " +
203 "?ForceMouselook, ?ScriptAccessPin, " + 203 "?CameraEyeOffsetZ, ?CameraAtOffsetX, " +
204 "?AllowedDrop, ?DieAtEdge, ?SalePrice, " + 204 "?CameraAtOffsetY, ?CameraAtOffsetZ, " +
205 "?SaleType, ?ColorR, ?ColorG, " + 205 "?ForceMouselook, ?ScriptAccessPin, " +
206 "?ColorB, ?ColorA, ?ParticleSystem, " + 206 "?AllowedDrop, ?DieAtEdge, ?SalePrice, " +
207 "?ClickAction, ?Material, ?CollisionSound, " + 207 "?SaleType, ?ColorR, ?ColorG, " +
208 "?CollisionSoundVolume, ?PassTouches, ?LinkNumber, ?MediaURL)"; 208 "?ColorB, ?ColorA, ?ParticleSystem, " +
209 209 "?ClickAction, ?Material, ?CollisionSound, " +
210 FillPrimCommand(cmd, prim, obj.UUID, regionUUID); 210 "?CollisionSoundVolume, ?PassTouches, ?LinkNumber, ?MediaURL)";
211 211
212 ExecuteNonQuery(cmd); 212 FillPrimCommand(cmd, prim, obj.UUID, regionUUID);
213 213
214 cmd.Parameters.Clear(); 214 ExecuteNonQuery(cmd);
215 215
216 cmd.CommandText = "replace into primshapes (" + 216 cmd.Parameters.Clear();
217 "UUID, Shape, ScaleX, ScaleY, " + 217
218 "ScaleZ, PCode, PathBegin, PathEnd, " + 218 cmd.CommandText = "replace into primshapes (" +
219 "PathScaleX, PathScaleY, PathShearX, " + 219 "UUID, Shape, ScaleX, ScaleY, " +
220 "PathShearY, PathSkew, PathCurve, " + 220 "ScaleZ, PCode, PathBegin, PathEnd, " +
221 "PathRadiusOffset, PathRevolutions, " + 221 "PathScaleX, PathScaleY, PathShearX, " +
222 "PathTaperX, PathTaperY, PathTwist, " + 222 "PathShearY, PathSkew, PathCurve, " +
223 "PathTwistBegin, ProfileBegin, ProfileEnd, " + 223 "PathRadiusOffset, PathRevolutions, " +
224 "ProfileCurve, ProfileHollow, Texture, " + 224 "PathTaperX, PathTaperY, PathTwist, " +
225 "ExtraParams, State, Media) values (?UUID, " + 225 "PathTwistBegin, ProfileBegin, ProfileEnd, " +
226 "?Shape, ?ScaleX, ?ScaleY, ?ScaleZ, " + 226 "ProfileCurve, ProfileHollow, Texture, " +
227 "?PCode, ?PathBegin, ?PathEnd, " + 227 "ExtraParams, State, Media) values (?UUID, " +
228 "?PathScaleX, ?PathScaleY, " + 228 "?Shape, ?ScaleX, ?ScaleY, ?ScaleZ, " +
229 "?PathShearX, ?PathShearY, " + 229 "?PCode, ?PathBegin, ?PathEnd, " +
230 "?PathSkew, ?PathCurve, ?PathRadiusOffset, " + 230 "?PathScaleX, ?PathScaleY, " +
231 "?PathRevolutions, ?PathTaperX, " + 231 "?PathShearX, ?PathShearY, " +
232 "?PathTaperY, ?PathTwist, " + 232 "?PathSkew, ?PathCurve, ?PathRadiusOffset, " +
233 "?PathTwistBegin, ?ProfileBegin, " + 233 "?PathRevolutions, ?PathTaperX, " +
234 "?ProfileEnd, ?ProfileCurve, " + 234 "?PathTaperY, ?PathTwist, " +
235 "?ProfileHollow, ?Texture, ?ExtraParams, " + 235 "?PathTwistBegin, ?ProfileBegin, " +
236 "?State, ?Media)"; 236 "?ProfileEnd, ?ProfileCurve, " +
237 237 "?ProfileHollow, ?Texture, ?ExtraParams, " +
238 FillShapeCommand(cmd, prim); 238 "?State, ?Media)";
239 239
240 ExecuteNonQuery(cmd); 240 FillShapeCommand(cmd, prim);
241
242 ExecuteNonQuery(cmd);
243 }
244
245 cmd.Dispose();
241 } 246 }
242 cmd.Dispose();
243 } 247 }
244 } 248 }
245 } 249 }