diff --git a/src/main/java/cz/cvut/kbss/termit/service/importer/excel/ExcelImporter.java b/src/main/java/cz/cvut/kbss/termit/service/importer/excel/ExcelImporter.java index f588798d..5de0002d 100644 --- a/src/main/java/cz/cvut/kbss/termit/service/importer/excel/ExcelImporter.java +++ b/src/main/java/cz/cvut/kbss/termit/service/importer/excel/ExcelImporter.java @@ -256,6 +256,8 @@ public Vocabulary importTermTranslations(@Nonnull URI vocabularyIri, @Nonnull Im } mergeTranslations(t, existingTerm.get()); termService.update(existingTerm.get()); + // Flush changes to prevent EntityExistsExceptions when term is already managed in PC as different type (Term vs TermInfo) + em.flush(); }); } catch (IOException e) { throw new VocabularyImportException("Unable to read input as Excel.", e);