16.03.2013, 15:12 | #1 |
Участник
|
axsa: Maximum open cursors in Dynamics AX
Источник: http://blogs.msdn.com/b/axsa/archive...namics-ax.aspx
============== This article is to dispel a myth about the maximum open cursors setting in Microsoft Dynamics AX. An important AOS change took place more than a year ago and awareness of it seems to be still quite low. The "you have exceeded the limit for open cursors" error message was removed from AX2009 (and AX2012) in kernel 5.0.1500.3212 onwards - KB 2266595. Yes it’s true! So now if you exceed the limit, you won't see any error. The full error was: "Upper limit for open cursors has been exceeded (90) - use parameter openCursors or change the X++ code." What used to happen is that when creating a new statement (for a query) in the AX kernel, it would check the open cursors parameter value, and if that session had that many statements in use then it would raise the event log error but continue and create the new statement anyway (by removing the oldest inactive ones to make space for the new one). The problem was that raising the error message itself actually leaked memory (!). As you can imagine once you've exceeded the limit then the error code might be hit a LOT of times as every statement created after that point may cause it to be raised. In AX2012 this was more important - as for X++ running as IL you don't know when the .NET garbage collector is actually going to dispose of objects - so statements that an AOS has cached might be hanging around for longer than you expect - and you could therefore hit the open cursors error all the time, just because they weren't being cleaned up at a predictable interval. So I hear you asking, what does this mean? Good question! It means that the open cursors setting is no longer something anyone should touch - because it's only related to an internal mechanism of AOS, and nothing is visible of that now - if no error is raised you don't know if you're exceeding the limit. The field will be left in the configuration utility and it will still do something when you set it, but the effect cannot be monitored, as it's purely an internal kernel mechanism. Setting the value higher will cause increased memory consumption, as the cache is allocated once for each session, so keeping it as default is a good option. This means anyone with open cursor errors in AX2009, just needs to update their kernel and it will go away, no need to attempt to change the value (it will cause memory problems) or troubleshoot their code, as the newer kernel will just handle it. /Tariq Bell Источник: http://blogs.msdn.com/b/axsa/archive...namics-ax.aspx
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору. |
|
21.04.2017, 14:37 | #2 |
Участник
|
Оригинально они подошли к вопросу.
Вот только похоже они там багов добавили и теперь в ядре курсоры утекают особенно на разноске проводок по складу когда идут запросы вида X++: CALL SCHEMANAME.AxUpdateInventOnHand('CompanyID', 'CompanyID', TransactionID) X++: execute sp_executesql N'UPDATE InventSum ... Как бы их подчищать ? Пробовал вызывать X++: Statement.close();
Statement = null; В 2012-й еще у класса Connection добавили метод Finalize() (возможно для решения этой проблемы). А в 2009-й его нет. Кто-нибудь сталкивался с такой проблемой ? Как можно от этого избавиться ? P.S. Ax 2009 build 1600.3596 (KB3138383 от 26.01.2016) Последний раз редактировалось Logger; 21.04.2017 в 14:39. |
|
Теги |
cursor, open cursor, tariq bell |
|
|