From 9387ac184f86c386d72892217332a69f9e399a99 Mon Sep 17 00:00:00 2001 From: Francesco Pio Scognamiglio Date: Tue, 26 Mar 2024 20:02:46 +0100 Subject: [PATCH] [DSC-1473] fix commit and clear of the context to be done after each page on item enhancer script --- .../dspace/content/enhancer/script/ItemEnhancerScript.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dspace-api/src/main/java/org/dspace/content/enhancer/script/ItemEnhancerScript.java b/dspace-api/src/main/java/org/dspace/content/enhancer/script/ItemEnhancerScript.java index bbe8a02122fa..c965edd6766d 100644 --- a/dspace-api/src/main/java/org/dspace/content/enhancer/script/ItemEnhancerScript.java +++ b/dspace-api/src/main/java/org/dspace/content/enhancer/script/ItemEnhancerScript.java @@ -74,9 +74,9 @@ private void enhanceItems(Context context) { int total = itemService.countArchivedItems(context); for (int offset = 0; offset < total; offset += PAGE_SIZE) { findItemsToEnhance(offset).forEachRemaining(this::enhanceItem); + context.commit(); + context.clear(); } - context.commit(); - context.clear(); } catch (SQLException e) { throw new SQLRuntimeException(e); }