From be23eb3cfc58f72df1822ee5fe00f9affa348cd7 Mon Sep 17 00:00:00 2001 From: jamesagnew Date: Sat, 27 Jun 2020 18:06:37 -0400 Subject: [PATCH] Move the flush into the existing transaction --- .../ca/uhn/fhir/jpa/term/TermCodeSystemStorageSvcImpl.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermCodeSystemStorageSvcImpl.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermCodeSystemStorageSvcImpl.java index 16ee4c2ee42..6775fd6f2f0 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermCodeSystemStorageSvcImpl.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermCodeSystemStorageSvcImpl.java @@ -713,6 +713,7 @@ public class TermCodeSystemStorageSvcImpl implements ITermCodeSystemStorageSvc { txTemplate.execute(t -> { link.forEach(id -> theDao.deleteByPid(id)); + theDao.flush(); return null; }); @@ -720,9 +721,6 @@ public class TermCodeSystemStorageSvcImpl implements ITermCodeSystemStorageSvc { ourLog.info(" * {} {} deleted ({}/{}) remaining - {}/sec - ETA: {}", count, theDescriptor, count, totalCount, sw.formatThroughput(count, TimeUnit.SECONDS), sw.getEstimatedTimeRemaining(count, totalCount)); } - txTemplate.executeWithoutResult(t -> { - theDao.flush(); - }); }