AXForum  
Вернуться   AXForum > Microsoft Dynamics AX > DAX Blogs
All
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск Все разделы прочитаны

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 16.03.2013, 15:12   #1  
Blog bot is offline
Blog bot
Участник
 
25,459 / 846 (79) +++++++
Регистрация: 28.10.2006
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  
Logger is offline
Logger
Участник
Лучший по профессии 2015
Лучший по профессии 2014
 
3,867 / 3123 (112) ++++++++++
Регистрация: 12.10.2004
Адрес: Москва
Записей в блоге: 2
Оригинально они подошли к вопросу.
Вот только похоже они там багов добавили и теперь в ядре курсоры утекают особенно на разноске проводок по складу когда идут запросы вида
X++:
CALL SCHEMANAME.AxUpdateInventOnHand('CompanyID', 'CompanyID', TransactionID)
или в случае SQL
X++:
execute sp_executesql N'UPDATE InventSum ...
Смотришь в сессию в которой активно разноски шли а там 4500 курсоров из которых 95 % вот такие запросы на обновление остатков.

Как бы их подчищать ?
Пробовал вызывать
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

 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
DAX: Official Dynamics AX 2012 R2 Content (update) - Where is it, and how can you find out about updates? Blog bot DAX Blogs 0 03.12.2012 11:11
crminthefield: Podcast and Overview: Microsoft Dynamics CRM 2011 Update Rollup 10 Blog bot Dynamics CRM: Blogs 0 17.08.2012 03:27
emeadaxsupport: New Content for Microsoft Dynamics AX 2012 : October 2011 Blog bot DAX Blogs 0 27.10.2011 17:11
axinthefield: Dynamics AX Event IDs Blog bot DAX Blogs 0 01.03.2011 22:11
axStart: Microsoft Dynamics AX 2009 Hot Topics Web Seminar Series Blog bot DAX Blogs 0 06.08.2008 12:05
Опции темы Поиск в этой теме
Поиск в этой теме:

Расширенный поиск
Опции просмотра

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 17:23.
Powered by vBulletin® v3.8.5. Перевод: zCarot
Контактная информация, Реклама.