diff --git a/src/main/java/edu/harvard/iq/dataverse/DatasetServiceBean.java b/src/main/java/edu/harvard/iq/dataverse/DatasetServiceBean.java index e519614ba55..c5ad9f17b0a 100644 --- a/src/main/java/edu/harvard/iq/dataverse/DatasetServiceBean.java +++ b/src/main/java/edu/harvard/iq/dataverse/DatasetServiceBean.java @@ -450,7 +450,8 @@ public DatasetLock addDatasetLock(Long datasetId, DatasetLock.Reason reason, Lon // (to prevent multiple, duplicate locks on the dataset!) DatasetLock lock = dataset.getLockFor(reason); if (lock != null) { - return lock; + //return lock; + return null; } // Create new: diff --git a/src/main/java/edu/harvard/iq/dataverse/engine/command/impl/UpdateDatasetVersionCommand.java b/src/main/java/edu/harvard/iq/dataverse/engine/command/impl/UpdateDatasetVersionCommand.java index f573203180b..26df909b5e4 100644 --- a/src/main/java/edu/harvard/iq/dataverse/engine/command/impl/UpdateDatasetVersionCommand.java +++ b/src/main/java/edu/harvard/iq/dataverse/engine/command/impl/UpdateDatasetVersionCommand.java @@ -14,6 +14,7 @@ import edu.harvard.iq.dataverse.engine.command.DataverseRequest; import edu.harvard.iq.dataverse.engine.command.RequiredPermissions; import edu.harvard.iq.dataverse.engine.command.exception.CommandException; +import edu.harvard.iq.dataverse.engine.command.exception.CommandExecutionException; import edu.harvard.iq.dataverse.engine.command.exception.IllegalCommandException; import edu.harvard.iq.dataverse.util.DatasetFieldUtil; import edu.harvard.iq.dataverse.util.FileMetadataUtil; @@ -147,6 +148,7 @@ public Dataset execute(CommandContext ctxt) throws CommandException { theDataset.addLock(lock); } else { logger.log(Level.WARNING, "Failed to lock the dataset (dataset id={0})", getDataset().getId()); + throw new CommandExecutionException("Failed to acquire lock on dataset", this); } editVersion.setDatasetFields(editVersion.initDatasetFields());