@jSylvestre don't hit the db inside a foreach loop, instead you should setup the persist but don't flush until you are finished iterating.