Looping through records - How does the DB call work

0
I’m curious. Lets say I have a “Ticket” entity and I have a list of 20,000 Tickets.   I want to change ALL Ticket’s to update the attribute “Done” to “true”. So I have me list, I create a LOOP and then I have a CHANGE activity (without committing) that updates this attribute. Then after the loop I commit the list. Does anyone know if this final commit makes a single call to the database to update all the records at once, or if it does 20,000 updates? 
asked
1 answers
1

Hi Brian,

Since you committed the list out of the loop at once, it makes one trip to the database and update all the records at once. Please refer to this page for more details;

https://academy.mendix.com/link/modules/21/lectures/300/3.4-Data-Handling-Optimizations

 

Best,

Ferhat

answered