What us the optimum value for Amount and Offset while retrieving large amount of objects?

0
I am having offset 0 and amount as 1000 while retrieving objects (In the same microflow, I am ending the transaction and changing the offset as "offset+amount"), But that scheduled event microflow stops working after certain number of objects, it stops after sometime. What should I do to optimize this process?
asked
2 answers
1

Hi Vivek,

 

Assuming you have built a loop according to the best practice.

 

  1. From Community Commons you could add https://docs.mendix.com/appstore/modules/community-commons-function-library/#37-orm endTransaction and beginTransaction in your terurn loop. Look in the documentation to see if the end transaction is not causing an undesired removal of a save point
  2. Use a smaller amount (like 200).
  3. Add logging to the return loop to detect if you have not, by accident, created an infinite loop. This could be caused by changing the object you use for selecting the batches. If so, perform the change in a different way.

 

Go Make It

 

Go Make It

answered
1

Hi Vivek, 

Besides the often used Endtransaction/BeginTransaction solution.

 

If your issue is caused by performance load on the microflow, also consider executing the batches inside the microflow in background or a queue. 

Always add some logging to monitor progression on the data and processing time.

answered