Skip to content
This repository has been archived by the owner on Apr 1, 2023. It is now read-only.

[리팩터링] SecurityContext 안의 Member 엔티티를 영속 상태로 변경 #204

Open
NaRDo627 opened this issue Jul 26, 2021 · 2 comments
Labels
application 소스, 어플리케이션 레벨 이슈 refactoring
Milestone

Comments

@NaRDo627
Copy link
Contributor

NaRDo627 commented Jul 26, 2021

이번에 출석체크 기능 작업하면서 알게된 사실인데, SecurityContext 속 엔티티도 영속 상태로 만들 수 있다!
(Interceptor 지점부터 Transactional 경계, 즉 영속성 컨텍스트 시작과 끝을 지정할 수 있을 것 같다.)
만약 Member 엔티티를 영속상태로 만들 수 있다면, 조회 수를 줄이는 등 코드를 좀 더 간결하게 만들 수 있을 것 같다.
물론 관련된 모든 코드가 수정 되어야 함..

@NaRDo627 NaRDo627 added application 소스, 어플리케이션 레벨 이슈 refactoring labels Jul 26, 2021
@NaRDo627 NaRDo627 added this to the 유지보수 milestone Jul 26, 2021
@Catnap421
Copy link
Contributor

영속 상태로 만들게 되면, 조회 수를 줄인다고 했는데, findBy를 통해서 Member 엔티티를 찾는 일이 줄어드는거야?

@NaRDo627
Copy link
Contributor Author

NaRDo627 commented Aug 2, 2021

영속 상태로 만들게 되면, 조회 수를 줄인다고 했는데, findBy를 통해서 Member 엔티티를 찾는 일이 줄어드는거야?

꼭 그렇다는건 아니지만, 이미 영속상태인 Member 엔티티를 이용해서 조회 로직을 조금 덜어낼 수 있지 않을까 생각했어!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
application 소스, 어플리케이션 레벨 이슈 refactoring
Projects
None yet
Development

No branches or pull requests

2 participants