Pull request #672: RED-6468 - Exception in persistence service for DownloadCleanupJob (very rarely)

Merge in RED/persistence-service from bugfix/RED-6468 to master

* commit 'a2feec73e65115063366223e4347e60f5fcf37cf':
  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:
Corina Olariu 2023-04-13 17:17:53 +02:00
commit 6220a85c76
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);
}