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 :
Finance | Project Operations, Human Resources, ...
Answered

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

(1) ShareShare
ReportReport
Posted on by 211
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.
I have the same question (0)
  • André Arnaud de Calavon Profile Picture
    299,149 Super User 2025 Season 2 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?  
  • BADRI NARAYANAN G Profile Picture
    211 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.
  • Kevin Xia Profile Picture
    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
    211 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
  • Verified answer
    Kevin Xia Profile Picture
    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

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 2,167

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 867 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 617 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans