From c9d33e263d0cc8c82b3d009dabdde18ca110ccf8 Mon Sep 17 00:00:00 2001 From: jingma Date: Fri, 9 Apr 2021 17:43:15 +0200 Subject: [PATCH] Handle posting same JSON twice. --- src/main/java/edu/harvard/iq/dataverse/LicenseServiceBean.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/edu/harvard/iq/dataverse/LicenseServiceBean.java b/src/main/java/edu/harvard/iq/dataverse/LicenseServiceBean.java index c49ebd9659e..37fae3501be 100644 --- a/src/main/java/edu/harvard/iq/dataverse/LicenseServiceBean.java +++ b/src/main/java/edu/harvard/iq/dataverse/LicenseServiceBean.java @@ -55,6 +55,7 @@ public License getByName(String name) throws FetchException { public License save(License license) throws PersistenceException, RequestBodyException { if (license.getId() == null) { em.persist(license); + em.flush(); return license; } else { throw new RequestBodyException("There shouldn't be an ID in the request body");