Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
@RequiredPermissions({})
public class UpdateDvObjectPIDMetadataCommand extends AbstractVoidCommand {

private final Dataset target;
private Dataset target;

public UpdateDvObjectPIDMetadataCommand(Dataset target, DataverseRequest aRequest) {
super(aRequest, target);
Expand All @@ -53,8 +53,7 @@ protected void executeImpl(CommandContext ctxt) throws CommandException {
Boolean doiRetString = pidProvider.updateIdentifier(target);
if (doiRetString) {
target.setGlobalIdCreateTime(new Timestamp(new Date().getTime()));
ctxt.em().merge(target);
ctxt.em().flush();
target = ctxt.em().merge(target);
// When updating, we want to traverse through files even if the dataset itself
// didn't need updating.
boolean isFilePIDsEnabled = ctxt.systemConfig().isFilePIDsEnabledForCollection(target.getOwner());
Expand All @@ -75,8 +74,6 @@ protected void executeImpl(CommandContext ctxt) throws CommandException {
doiRetString = pidProvider.updateIdentifier(df);
if (doiRetString) {
df.setGlobalIdCreateTime(new Timestamp(new Date().getTime()));
ctxt.em().merge(df);
ctxt.em().flush();
}
}
}
Expand Down