RED-6468 - Exception in persistence service for DownloadCleanupJob (very rarely)

- changed the lazy loading to eager for dossier in download status entity
This commit is contained in:
devplant 2023-04-13 12:33:44 +03:00
parent 079d48c0e4
commit a2feec73e6
2 changed files with 2 additions and 2 deletions

View File

@ -61,7 +61,7 @@ public class DownloadStatusEntity {
@Column
long fileSize;
@ManyToOne(fetch = FetchType.LAZY)
@ManyToOne(fetch = FetchType.EAGER)
DossierEntity dossier;
@ManyToMany

View File

@ -63,7 +63,7 @@ public class DownloadCleanupJob implements Job {
downloadStatus.getCreationDate().plusHours(applicationConfigurationEntity.getDownloadCleanupNotDownloadFilesHours()),
now);
deleteDownload(downloadStatus);
} else if (dossier != null && dossierService.getDossierById(dossier.getId()).getSoftDeletedTime() != null) {
} else if (dossier != null && dossier.getSoftDeletedTime() != null) {
log.info("3. Deleting download {}, because dossier does not exist", downloadStatus.getStorageId());
deleteDownload(downloadStatus);
}