Skip to content

Commit 7d8714a

Browse files
committed
restore export time method lost in merge
1 parent 6968009 commit 7d8714a

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

src/main/java/edu/harvard/iq/dataverse/DatasetServiceBean.java

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1156,5 +1156,19 @@ public void saveStorageQuota(Dataset target, Long allocation) {
11561156
}
11571157
em.flush();
11581158
}
1159-
1159+
1160+
@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
1161+
public void setLastExportTimeInNewTransaction(Long datasetId, Date lastExportTime) {
1162+
try {
1163+
Dataset currentDataset = find(datasetId);
1164+
if (currentDataset != null) {
1165+
currentDataset.setLastExportTime(lastExportTime);
1166+
merge(currentDataset);
1167+
} else {
1168+
logger.log(Level.SEVERE, "Could not find Dataset with id={0} to retry persisting archival copy location after OptimisticLockException.", datasetId);
1169+
}
1170+
} catch (Exception e) {
1171+
logger.log(Level.SEVERE, "Failed to retry export after OptimisticLockException for dataset id=" + datasetId, e);
1172+
}
1173+
}
11601174
}

0 commit comments

Comments
 (0)