Skip to main content
Dynamics 365 Community / Forums / Finance forum / The operation is takin...
Finance forum
Answered

The operation is taking too long to process in batch.Box API interactive sessions

editSubscribe (0) ShareShare
ReportReport
Posted on by 121
Hi Friends,
I am running a batch process named /update category billing rules/.While i was debugging code in the service class i found that the control gets stuck in query.next() statement inside the while loop.
 
 
Hence i took the query and ran it in SQL and i faced this error./There is not enough space on the disk/
 
So to get the row count of records i ran only 3 lines in the above highlighted query and found that there were 80lakh records.After few hours of running the batch process i got a dialog message saying /Operation is taking too long/ and then the batch process gave errors saying /Box API cant be used from non-interactive sessions./ and /batch task failed/.
Please let me know if there is any solution for this issue.Thanks.
Attachments
  • Verified answer
    Kevin Xia Profile Picture
    Kevin Xia Microsoft Employee on at
    The operation is taking too long to process in batch.Box API interactive sessions
    Hi,
    Glad that your issue was resolved, you can mark the thread as verified to help other users of the forum better view the post.
    Best regards,
    Kevin
  • BADRI NARAYANAN G Profile Picture
    BADRI NARAYANAN G 121 on at
    The operation is taking too long to process in batch.Box API interactive sessions
    Thanks for your response Kevin.

    Actually the problem was with the join used in the Query.We are using inner join between the table PSAContractLineItems and ProjTable due to which the result set was loaded with records having duplicate billing rule id's.Requirement was to fetch only one billing rule id and hence applying exist join was the solution.After applying exist join it matched one record and it returned the record.Even if there was more than one match the exist join will not consider it.Anyhow optimizing the query by using Exist join solved the issue.Thanks for all your response.
     
    Thank you
    Badri
  • Kevin Xia Profile Picture
    Kevin Xia Microsoft Employee on at
    The operation is taking too long to process in batch.Box API interactive sessions
    Hi,
    Judging from your description, the problem may be an error caused by an operation timeout. You can try to solve the query timeout problem in your code, and the error message will be resolved. You can try to optimize the SQL query statement or query in batches to solve the problem of query timeout.
    Best regards,
    Kevin
  • BADRI NARAYANAN G Profile Picture
    BADRI NARAYANAN G 121 on at
    The operation is taking too long to process in batch.Box API interactive sessions
    Hi Andre,thanks for your response.
    80 lakh is 8 million records returned by the query.The select statement shown in the screenshot has a total of 4 datasources namely
    Projinvoicetable,PSAContractLineItem,ProjTable,ProjGroup.The query shown in the screenshot is the same used by queryRun() object in service class.
    The logic inside while loop is just to update the categories of the billing rules based on the contract id.Btw if i give a filter for contract id i.e i gave 5 contract id's
    then the batch is working fine.If there is no filter i.e if all the contract id's is given as input to the batch then it is running for infinite time and throwing the error which i mentioned.
    This is the storage of AxDB.
  • Andre Arnaud de Calavon Profile Picture
    Andre Arnaud de Cal... 283,130 Super User on at
    The operation is taking too long to process in batch.Box API interactive sessions
    Hi Badri,
     
    Have you checked if you need to free up disk space or extend the drive? 80lakh is 8 million, I thought. Can you share the remaining part of the coding? What exactly is your loop doing? What data sources do you have in the queryRun? Is that the same query as the first query in the last screenshot?  

Helpful resources

Quick Links

New Blog Features Released!

Check out the new community blog features for viewers and authors…

Setting Up Knowledge Sources for Copilot…

Look at how configuring a comprehensive knowledge base is crucial…

Demystifying Copilot with Georg Glantschnig…

Industry experts answer burning questions directly from our amazing Community…

Leaderboard

#1
Andre Arnaud de Calavon Profile Picture

Andre Arnaud de Cal... 283,130 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 222,689 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,138

Featured topics

Product updates

Dynamics 365 release plans