Skip to Content
4
Former Member
Feb 16, 2017 at 07:51 PM

ModelService remove() vs removeAll()

1174 Views

Hi all, I have a requirement to remove all the expired price rows from the database using a cron job.
What I'm currently doing is fetching the list of such PriceRowModels and passing it to modelService.removeAll() function. The count of the models is 1,300,000+. The job ran for more than 2 hours and had to be aborted and the change in count was only a mere 4.

i.e. Before : 1,300,004
After: 1,300,000

Now, I kept on querying while the job was running and the count didn't change at all. I've also tried this by bringing the total count down to 83,000+ but still the same issue.

Any idea why is this happening?

Also, would it be better to just iterate the list of models and use the remove() function for one model at a time?

Thanks.