diff --git a/dspace-api/src/main/java/org/dspace/app/itemimport/ItemImportServiceImpl.java b/dspace-api/src/main/java/org/dspace/app/itemimport/ItemImportServiceImpl.java index 176d82b451..e424e75e6c 100644 --- a/dspace-api/src/main/java/org/dspace/app/itemimport/ItemImportServiceImpl.java +++ b/dspace-api/src/main/java/org/dspace/app/itemimport/ItemImportServiceImpl.java @@ -561,10 +561,16 @@ public class ItemImportServiceImpl implements ItemImportService, InitializingBea { if (!isTest) { + ArrayList removeList = new ArrayList<>(); List collections = myitem.getCollections(); - // Remove item from all the collections it's in + // Save items to be removed to prevent concurrent modification exception DS-3322 for (Collection collection : collections) { + removeList.add(collection); + } + + // Remove item from all the collections it's in + for (Collection collection : removeList) { collectionService.removeItem(c, collection, myitem); } }