From f5d7a616f6941cdc4867cc8d19f19538bd0e5a4e Mon Sep 17 00:00:00 2001 From: Philip Durbin Date: Fri, 26 Jun 2020 15:47:57 -0400 Subject: [PATCH] prevent database deadlocks #6846 #6865 #7020 --- .../command/impl/FinalizeDatasetPublicationCommand.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/edu/harvard/iq/dataverse/engine/command/impl/FinalizeDatasetPublicationCommand.java b/src/main/java/edu/harvard/iq/dataverse/engine/command/impl/FinalizeDatasetPublicationCommand.java index ef67a661352..92963c28d51 100644 --- a/src/main/java/edu/harvard/iq/dataverse/engine/command/impl/FinalizeDatasetPublicationCommand.java +++ b/src/main/java/edu/harvard/iq/dataverse/engine/command/impl/FinalizeDatasetPublicationCommand.java @@ -187,6 +187,11 @@ public Dataset execute(CommandContext ctxt) throws CommandException { @Override public boolean onSuccess(CommandContext ctxt, Object r) { + // This sleep is an attempt to avoid database deadlocks. + try { + Thread.sleep(3000); + } catch (InterruptedException ex) { + } boolean retVal = true; Dataset dataset = null; try{