var items = job.getItems();
for (var item in items)
job.removeItem(item);
And CF / Java throws
java.util.ConcurrentModificationException
at
java.util.AbstractList$Itr.checkForComodification(AbstractList.java:372)
What’s the cleanest way to remove all items without ConcurrentModificationException?
Thank you!
A java List has an (optional) clear() method.
The code would then become :
AFAICS coldfusion9 uses hibernate as ORM, and hibernate does implement clear on the List abstraction, and will even translate it to a single DELETE statement to the database.