[英]What's best way to get all NodieIds or all NodeAliasPaths API 7
I collected NodeIds (22,000 of them) to List and passed them to 我将NodeIds(其中22,000个)收集到List中并将其传递给
tree.SelectSingleNode(NodeID) // Kentico API7
Whether I use 我是否使用
tree.SelectSingleNode(NodeID)
or its equivalent for NodeAliasPath
或等效的
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: 都返回一个允许操作Node数据的节点,我在任一行上都遇到内存不足错误:
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'.
托管调试助手“ FatalExecutionEngineError”已在“ 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.
错误的地址位于线程0x5330上的0x005228e7。 The error code is 0x80131623.
错误代码为0x80131623。 This error may be a bug in the CLR or in the unsafe or non-verifiable portions of user code.
此错误可能是CLR或用户代码中不安全或不可验证部分的错误。 Common sources of this bug include user marshaling errors for COM-interop or PInvoke, which may corrupt the stack.
该错误的常见来源包括COM-interop或PInvoke的用户封送处理错误,这些错误可能会破坏堆栈。
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.
如果您正在运行多租户环境,则还可以在where子句中指定SiteID。 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.
您还可以指定要接收或修改的列,这也将有助于您带回的数据量。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.