diff --git a/backend/src/main/java/org/raddatz/familienarchiv/document/DocumentService.java b/backend/src/main/java/org/raddatz/familienarchiv/document/DocumentService.java index 2b428b70..e4bd434d 100644 --- a/backend/src/main/java/org/raddatz/familienarchiv/document/DocumentService.java +++ b/backend/src/main/java/org/raddatz/familienarchiv/document/DocumentService.java @@ -636,7 +636,8 @@ public class DocumentService { return saved; } - // 0. Zuletzt aktive Dokumente (sortiert nach updatedAt DESC) + // @Transactional(readOnly=true) keeps the Hibernate session open so the + // lazy-loaded sender and tags on returned documents remain accessible to callers. @Transactional(readOnly = true) public List getRecentActivity(int size) { return documentRepository.findAll( @@ -845,6 +846,8 @@ public class DocumentService { documentRepository.save(doc); } + // @Transactional(readOnly=true) keeps the Hibernate session open so the + // lazy-loaded tags and receivers on the returned document remain accessible to callers. @Transactional(readOnly = true) public Document getDocumentById(UUID id) { Document doc = documentRepository.findById(id)