Skip to main content

Notifications

Microsoft Dynamics AX (Archived)

update_recordset hangs/ doesn't finish execution

Posted on by 1,669

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

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: update_recordset hangs/ doesn't finish execution

    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;

    ?

  • Suggested answer
    Vilmos Kintera Profile Picture
    Vilmos Kintera 46,149 on at
    RE: update_recordset hangs/ doesn't finish execution

    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.

  • Iulian Cordobin Profile Picture
    Iulian Cordobin 8,201 on at
    RE: update_recordset hangs/ doesn't finish execution

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

    Also do you have database log activated on this table?

  • Mea_ Profile Picture
    Mea_ 60,278 on at
    RE: update_recordset hangs/ doesn't finish execution

    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.

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Complete!

🔔 Be sure to subscribe to the new forums you are interested in to stay up to date! 🔔

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,902 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 229,316 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans