Skip to main content

Notifications

Announcements

No record found.

Business Central forum
Suggested answer

Facing an error in job queue

Posted on by 173
I have a job queue which basically fetches data from third-party software and stores in business central. This table in businesss central has around 439 fields so this job queue takes a lot of time. Meanwhile, we are storing all fetched data from API call inside json buffer table. But for up to 5000 records, it is running fine but for more than that it is showing following error:
We can't save your changes right now, because a record in table 'JSON Buffer' is being updated in a transaction done by another session.

You'll have to wait until the other transaction has completed, which may take a while. Please try again later.


We have also increased job timeout to 18 to 23 hours still it is failing within 11 hours. No user has been working on the table as well.



  • Pragya752 Profile Picture
    Pragya752 173 on at
    Facing an error in job queue
    I have set one record per page only.
     
    Pagingobject.Add('PageIndex', PageIndex);
            Pagingobject.Add('PageSize', LSQSetp.PageSize);
            JObject.Add('Paging', Pagingobject);
     JObject.Add('Columns', IncludeCSVObject);
            SortingObject.Add('ColumnName', 'CreatedOn');
            SortingObject.Add('Direction', 1);
            JObject.Add('Sorting', SortingObject);
      if Response.IsSuccessStatusCode then begin
                Response.Content().ReadAs(ResponseText);
                //Message(ResponseText);
                JsonBuffer.Reset();
                if JsonBuffer.FindSet() then
                    JsonBuffer.DeleteAll();
                jsonBufferTemp.ReadFromText(ResponseText);
                if jsonBufferTemp.FindSet() then
                    repeat
                        JsonBuffer := jsonBufferTemp;
                        JsonBuffer.Insert();
                    until jsonBufferTemp.Next() = 0;
  • Suggested answer
    KasparsSemjonovs Profile Picture
    KasparsSemjonovs 3,660 Super User 2024 Season 2 on at
    Facing an error in job queue
    Sankar P is correct. Paging should solve the issue. 
    It is know that Business Central limits queries or records to 5000. Similar as You cannot export to excel more than 5000 lines. In NAV it was possible to change this limit in ClientUserSettings file, but for BC not sure if it can be done via CMDLETs. You can explore in this direction.
  • Facing an error in job queue
    Hi,
    ÃŒs it possible to do pageing in your API and read <5K records at a time to process and store it and use commit before u call for next pageing.
     
     
  • Judy Profile Picture
    Judy Microsoft Employee on at
    Facing an error in job queue
    Hi,
     
    Have you tried to restart the environment? Please restart the Job related and restart the API rest and run it again to see if the error occurred.
    The following Document help you troubleshoot issues with Business Central so that you can gather information about a given problem, identify the cause of the problem, and eventually implement a sustainable solution
     
     
     
    Best Regards,
    Judy

Helpful resources

Quick Links

Dynamics 365 Community Update – Sep 9th

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

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 228,137 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans