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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

to avoid conflicts during multi threading

(0) ShareShare
ReportReport
Posted on by

We are having some classes to import some items 
and we have implemented concept  of  multi threading
we found that during import we are not able to import all the items through batch , but while running the class manually all the items are completely imported
while debugging we came to know that there is some conflict occurring due to which some of the items are not getting created 
we have also given number of retries when a conflict occur , while increasing the number of retries all items are getting imported perfectly ,but it takes more time which is not a good practice 

please help me to find a solution 

Thanks in Advance 

Lishu 

*This post is locked for comments

I have the same question (0)
  • Verified answer
    André Arnaud de Calavon Profile Picture
    300,904 Super User 2025 Season 2 on at

    Hi Lishu,

    Can you elaborate on the job? What should it exactly do? Importing items itself or item related journals? What is the source? Do you create a thread per item or bundle with e.g. 100 items? During the batch, how many records are processed usually?

  • Verified answer
    Mea_ Profile Picture
    60,284 on at

    Hi lishu,

    Please read this article blogs.msdn.microsoft.com/.../batch-parallelism-in-ax-part-iii it explains how to use pessimistic  with batch to avoid this issue

  • Verified answer
    Martin Dráb Profile Picture
    237,795 Most Valuable Professional on at

    In general, you should try to split the work in a way that no two threads work on the same data. If it's necessary, the risk of update conflicts is high and therefore you should rather use pessimistic concurrency control. It will hurt concurrency, so yo have to design carefully what and when you lock, but retrying the work many times isn't any more efficient.

  • Community Member Profile Picture
    on at

    i want to import some items with their dimensions like color ,size,style etc...,i am importing from a txt document ,even while importing 5 items in a batch conflict happens and only one item is getting imported

  • Community Member Profile Picture
    on at

    Thank you ievgen I am trying with it

    hope  it should work

    thank You

  • André Arnaud de Calavon Profile Picture
    300,904 Super User 2025 Season 2 on at

    If you have a source file, you would first have to insert it in a staging and then see how to divide the workload over multiple threads. Also the other note above are important to consider. Have you also considered using Data Import Export Framework? This tool is able to import a file very quickly in a staging table and then do the staging to target using the batch framework. If you have e.g. 50 items in the file, I would not consider using multiple threads to avoid update conflicts. A load of 50000 is different.

  • udaY-ch Profile Picture
    5,128 on at

    Did you try debugging on the same and to find what makes it process a single data out of 5.

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans