fix(admin-group-deatil-info): add transactional annotation#89
Merged
minsoo0506 merged 1 commit intodevfrom Jan 30, 2026
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
변경 사항
이 문제는 Repository 메소드(예: findById)가 실행될 때만 잠깐 데이터베이스 세션이 열렸다가, 메소드가 끝나자마자 바로 닫히기 때문에 발생합니다. 이미 DB 세션이 닫혔는데 Service 계층에서 메서드를 호출하려고 하면 이미 연결이 끊겨서 위와 같은 에러 메시지가 뜨게 되는 거죠...
따라서 @transactional(readOnly = true)를 서비스 메서드 위에 붙여주었습니다. 위 어노테이션을 붙이게 되면 메소드 시작부터 끝까지 데이터베이스 연결(영속성 컨텍스트)을 계속 유지합니다.