diff --git a/deidentifier-pipeline/src/main/java/org/ratschlab/deidentifier/workflows/WriteDocsToDatabase.java b/deidentifier-pipeline/src/main/java/org/ratschlab/deidentifier/workflows/WriteDocsToDatabase.java index ede8271..208bc19 100644 --- a/deidentifier-pipeline/src/main/java/org/ratschlab/deidentifier/workflows/WriteDocsToDatabase.java +++ b/deidentifier-pipeline/src/main/java/org/ratschlab/deidentifier/workflows/WriteDocsToDatabase.java @@ -51,7 +51,7 @@ public void doneHook() { } } - private void flushQueue() throws SQLException { + private synchronized void flushQueue() throws SQLException { List>> lst = new ArrayList<>(); while (!writeQueue.isEmpty()) {