diff --git a/backend/CLAUDE.md b/backend/CLAUDE.md index 5a0e281a..249221cc 100644 --- a/backend/CLAUDE.md +++ b/backend/CLAUDE.md @@ -97,7 +97,10 @@ public class MyEntity { - Annotated with `@Service`, `@RequiredArgsConstructor`, optionally `@Slf4j`. - Write methods: `@Transactional`. -- Read methods: no annotation (default non-transactional). +- Read methods: no annotation (default non-transactional) — **except** when the method returns + an entity whose lazy associations must remain accessible to the caller after the method + returns. In that case, use `@Transactional(readOnly = true)` to keep the Hibernate session + open. Removing this annotation causes `LazyInitializationException` in production. See ADR-022. - Cross-domain access goes through the other domain's service, never its repository. ## Error Handling