web
You’re offline. This is a read only version of the page.
close
Skip to main content
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,284 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.

  • Iulian Cordobin Profile Picture
    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?

  • Suggested answer
    Vilmos Kintera Profile Picture
    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.

  • Community Member Profile Picture
    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;

    ?

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Pallavi Phade – Community Spotlight

We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Tocauer Profile Picture

Martin Tocauer 4

#2
AlissonGodoy Profile Picture

AlissonGodoy 2

#2
NNaumenko Profile Picture

NNaumenko 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans