diff --git a/src/umbraco.cms/businesslogic/CMSNode.cs b/src/umbraco.cms/businesslogic/CMSNode.cs index d325720aa4..9aec9a16b1 100644 --- a/src/umbraco.cms/businesslogic/CMSNode.cs +++ b/src/umbraco.cms/businesslogic/CMSNode.cs @@ -1,7 +1,7 @@ using System; using System.Collections.Generic; using System.Data; - +using System.Runtime.CompilerServices; using System.Xml; using umbraco.cms.businesslogic.web; @@ -1036,6 +1036,12 @@ order by level,sortOrder"; } + /// + /// This needs to be synchronized since we are doing multiple sql operations in one method + /// + /// + /// + [MethodImpl(MethodImplOptions.Synchronized)] protected void SavePreviewXml(XmlNode x, Guid versionId) { string sql = PreviewExists(versionId) ? "UPDATE cmsPreviewXml SET xml = @xml, timestamp = @timestamp WHERE nodeId=@nodeId AND versionId = @versionId" diff --git a/src/umbraco.cms/businesslogic/web/Document.cs b/src/umbraco.cms/businesslogic/web/Document.cs index 93275ccdfe..b006f220f1 100644 --- a/src/umbraco.cms/businesslogic/web/Document.cs +++ b/src/umbraco.cms/businesslogic/web/Document.cs @@ -1756,6 +1756,10 @@ where published = 1 And nodeId = @nodeId And trashed = 0", SqlHelper.CreateParam } } + /// + /// This is a specialized method which literally just makes sure that the sortOrder attribute of the xml + /// that is stored in the database is up to date. + /// public void refreshXmlSortOrder() { if (Published) @@ -2002,6 +2006,11 @@ where published = 1 And nodeId = @nodeId And trashed = 0", SqlHelper.CreateParam return temp; } + /// + /// This needs to be synchronized since we're doing multiple sql operations in the single method + /// + /// + [MethodImpl(MethodImplOptions.Synchronized)] private void saveXml(XmlNode x) { bool exists = (SqlHelper.ExecuteScalar("SELECT COUNT(nodeId) FROM cmsContentXml WHERE nodeId=@nodeId",