web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

update_recordset hangs/ doesn't finish execution

(0) ShareShare
ReportReport
Posted on by 1,673

Hi everyone

I need help regarding the update_recordset. 

The one I have implemented in my code works for small amounts of data but hangs for large amounts of data (ie. 12000 records)

The statement looks like this:

update_recordSet mytable

setting

ImportStatus = _status,
HasError        = NoYes::No,
InfologData   = conNull()

where mytable.field1 = _field1

&& mytable.field2 = _field2;

- ImportStatus is an enum, HasError is an Enum, InfologData a container

- myTable has no code on it; it does not have an overridden update method

- Also tried AOS restart and CIL compilation

Yesterday this statement took up to 14 hours to execute with no result; we had to kill the Ax session.

Does anyone know what the problem is or have any solutions or know how to update/optimise this?

Thank you

*This post is locked for comments

I have the same question (0)
  • Mea_ Profile Picture
    60,286 on at

    Hi BrandonSA,

    Did you try to look at blocking transactions report in SQL management studio while you are executing this statement ?

    Because if this table is updated via another transaction it could be locked by another update\delete\insert statement.

  • Iulian Cordobin Profile Picture
    8,201 on at

    When you say small amounts of data what number are you talking about?

    Also do you have database log activated on this table?

  • Suggested answer
    Vilmos Kintera Profile Picture
    46,149 on at

    Do you have any validateField, modifiedField, validateWrite, or update method overrides on your table?

    If yes, the set-based operation will fall back from SQL to row-based operation, so it would take a long time.

    Also make sure you have a clustered, or non-clustered index on field1 and field2 otherwise SQL will do table scan which is killing performance.

  • Community Member Profile Picture
    on at

    container test = connull();

    mytable.skipDatabaseLog(true);
    mytable.skipDataMethods(true);

    mytable.skip...

    update_recordSet mytable

    setting

    ImportStatus = _status,
    HasError        = NoYes::No,
    InfologData   = test 

    where mytable.field1 = _field1

    && mytable.field2 = _field2;

    ?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
CP04-islander Profile Picture

CP04-islander 21

#2
dekion Profile Picture

dekion 4

#2
Virginia99 Profile Picture

Virginia99 4

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans