node.Insert method gives SQL timeout

Douglas Fittipaldi asked on December 13, 2024 23:38

Hello:

Very weird issue here. We're building out a new Kentico site with version 13.0.138 and we also have a separate site for users to insert a node into the tree. Here's some sample code:

TreeProvider provider = new TreeProvider(MembershipContext.AuthenticatedUser);
TreeNode parent = provider.SelectSingleNode("##site name##", "##node path##", "en-us");
TreeNode node = TreeNode.New("##class type##", provider);
node.NodeAlias = ##path variable##;
node.DocumentName = ##doc name variable##;
node.DocumentCulture = "en-us";
node.Insert(parent);

This does insert the new node into the tree where it belongs, but the Insert method never returns. It just gives me a SQL timeout. It's a long query so I'll just only put part of it here but let me know if you want me to paste the full query:

SELECT *
FROM CMS_PageFormerUrlPath
WHERE (([PageFormerUrlPathNodeID] IN (
    SELECT [NodeID]
FROM View_CMS_Tree_Joined AS V WITH (NOLOCK, NOEXPAND) LEFT OUTER JOIN COM_SKU AS S WITH (NOLOCK) ON [V].[NodeSKUID] = [S].[SKUID] WHERE ([NodeLinkedNodeID] IN (
    SELECT [NodeID]
FROM View_CMS_Tree_Joined AS V WITH (NOLOCK, NOEXPAND) INNER JOIN NinetyTwoY_ProductionEvent AS C WITH (NOLOCK) ON [V].[DocumentForeignKeyValue] = [C].[ProductionEventID] AND V.ClassName = N'NinetyTwoY.ProductionEvent' LEFT OUTER JOIN COM_SKU AS S WITH (NOLOCK) ON [V].[NodeSKUID] = [S].[SKUID] WHERE ([DocumentID] = @DocumentID)
))

One last thing to note is that this is only a problem with one of the sites. I tried a different site and there was no issue. I understand if this isn't a lot to go on so feel free to ask for more. Thanks for any help you can give me.

   Please, sign in to be able to submit a new answer.