diff --git a/persistence-service-v1/persistence-service-processor-v1/src/main/java/com/iqser/red/service/persistence/management/v1/processor/entity/download/DownloadStatusEntity.java b/persistence-service-v1/persistence-service-processor-v1/src/main/java/com/iqser/red/service/persistence/management/v1/processor/entity/download/DownloadStatusEntity.java index 544b9ba28..ad6852b22 100644 --- a/persistence-service-v1/persistence-service-processor-v1/src/main/java/com/iqser/red/service/persistence/management/v1/processor/entity/download/DownloadStatusEntity.java +++ b/persistence-service-v1/persistence-service-processor-v1/src/main/java/com/iqser/red/service/persistence/management/v1/processor/entity/download/DownloadStatusEntity.java @@ -61,7 +61,7 @@ public class DownloadStatusEntity { @Column long fileSize; - @ManyToOne(fetch = FetchType.LAZY) + @ManyToOne(fetch = FetchType.EAGER) DossierEntity dossier; @ManyToMany diff --git a/persistence-service-v1/persistence-service-processor-v1/src/main/java/com/iqser/red/service/persistence/management/v1/processor/service/job/DownloadCleanupJob.java b/persistence-service-v1/persistence-service-processor-v1/src/main/java/com/iqser/red/service/persistence/management/v1/processor/service/job/DownloadCleanupJob.java index b4059f884..e1a4acd06 100644 --- a/persistence-service-v1/persistence-service-processor-v1/src/main/java/com/iqser/red/service/persistence/management/v1/processor/service/job/DownloadCleanupJob.java +++ b/persistence-service-v1/persistence-service-processor-v1/src/main/java/com/iqser/red/service/persistence/management/v1/processor/service/job/DownloadCleanupJob.java @@ -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); }