What's best way to get all NodieIds or all NodeAliasPaths API 7

0

I collected NodeIds (22,000 of them) to List and passed them to

tree.SelectSingleNode(NodeID) // Kentico API7

Whether I use

tree.SelectSingleNode(NodeID) 

or its equivalent for NodeAliasPath

tree.SelectSingleNode(CMSContext.CurrentSiteName, aliaspath, culture) 

with both returning a node that allows manipulation of Node data, I get a out of memory error on either line:

tree.SelectSingleNode(NodeID) 

tree.SelectSingleNode(CMSContext.CurrentSiteName, aliaspath, culture)

Is the error message due to the code or the environment?

Here's the error message:

Managed Debugging Assistant 'FatalExecutionEngineError' has detected a problem in 'C:\Users\xxxxxxx\Documents\Visual Studio 2013\Projects\ConsoleApplication4\ConsoleApplication4\bin\Debug\ConsoleApplication4.vshost.exe'.

Additional information: The runtime has encountered a fatal error. The address of the error was at 0x005228e7, on thread 0x5330. The error code is 0x80131623. This error may be a bug in the CLR or in the unsafe or non-verifiable portions of user code. Common sources of this bug include user marshaling errors for COM-interop or PInvoke, which may corrupt the stack.

c#
kentico
asked on Stack Overflow Jan 28, 2016 by KenticoLover • edited Jun 20, 2020 by Community

1 Answer

2

It appears you're getting the information correctly. Problem is you simply have too many nodes and run out of memory when storing all that data in memory. What I'd do is get the data and process it in batches. If you're running a multi-tenancy environment, you might also specify a SiteID in your where clause. You can also specify the columns you want to receive back or modify and this will also help with the amount data you're bringing back.

answered on Stack Overflow Jan 28, 2016 by Brenden Kehren

User contributions licensed under CC BY-SA 3.0