node.insert crashes
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.
Environment
- Xperience by Kentico version: 13.0.138
- .NET version: 8
Answers
My first thought was, why should Users insert nodes into the tree node with another application than the CMS? What do you intend to do? Why this indirect content creation? Isn't it easier to log into the CMS and do whatever should be added there?
It looks very performance intensive to crawl all NodeIDs to check for former URLs. Maybe because it is inserted as TreeNode and not as typed document via the document info provider methods? This is something I would ask the support.
You could raise the timeout.
You could try to add more details to get a more concrete query.
You could use the query depug helper in Kentico.
You could check if old data could be deleted from the database, like history or versioning or the former URL data if not needed.
For Kentico 13 you may also ask the Kentico DevNet forum. Maybe here you get help, too. The community portal is more XbyK focussed.
Elmar is correct, please use the DevNet forums for all questions related to Kentico Xperience 13 and earlier versions of Kentico.
The Kentico Community Portal is focused on Xperience by Kentico only.
To answer this question, you have to login first.