-
Notifications
You must be signed in to change notification settings - Fork 29
Feature/opixxx step1 #21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- 세션을 사용하여 회원가입, 로그인 구현 - ArgumentResolver 을 활용 하여 로그인 회원 정보 조회 - 인터셉터를 사용하여 사용자 인증 기능 구현
- 다른 패키지에서 빈을 인식을 못하는 버그가 인텔리제이 있어 패키지를 member 내부로 이동
- 회원 가입 시 EventListener 를 통해 메인 계좌 생성 이벤트를 발행 - session 에 accountId 메인 계좌 PK를 추가 - 사용자와 메인 계좌는 1:1 관계라고 생각해서 같이 조회되는 경우가 많을 것이라고 생각되서 Member 에서 accountId 를 관리하도록 구현
- 회원 가입 시 EventListener 를 통해 메인 계좌 생성 이벤트를 발행 - session 에 accountId 메인 계좌 PK를 추가 - 사용자와 메인 계좌는 1:1 관계라고 생각해서 같이 조회되는 경우가 많을 것이라고 생각되서 Member 에서 accountId 를 관리하도록 구현
- 스케줄러를 사용하여 00시 00분에 현재 충전 한도가 3,000,000 이하인 메인 계좌를 조회 후 3,000,000으로 초기화 하도록 구현함 - jdbcTemplate 를 사용해서 배치 쿼리를 작성함
- 송금 트랜잭션 격리 수준 Read Committed + 낙관적 락으로 구현 -
|
This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation. |
|
ZZAMBAs
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
잘 봤습니다! 낙관적 락 방식과 JPA 더티 체킹을 이용해서 DB에 락을 최소화하신 것 같고 이에 따라 동시성 성능이 좋을 것 같다는 생각입니다. 고생 많으셨어요!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이벤트 발행을 통한 처리는 신선했던 것 같아요
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
관련 클래스에 상수를 적지 않고 따로 상수 클래스에 상수를 모아두신 이유가 있을까요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
여러 클래스에서 상수 값이 사용되는 경우가 빈번하다보니 하나의 상수 클래스에서 관리한 것 같습니다.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
아주 꼼꼼히 작성하신 것 같아요. 여기에 추가적인 동시성 테스트도 있으면 좋을 것 같습니다. 예를 들면 메인 계좌에서 다른 계좌로 돈이 빠져나가는 상황이 동시에 발생하는 상황처럼요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
step2에서 송금에서의 동시성 테스트 작성해보겠습니다
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
저는 전제는 메인 계좌에 접근하려고 하는 트랜잭션이 많을것이다(ex : 메인 => 적금 계좌로 돈을 충전할때, 여러계좌에서 메인계좌로 돈이 충전될때) 생각해서 그로인한 Non-Repeatable Read 를 방지하고자 Repeatable Read를 선택했는데, 실제 상황을 생각해보니 Read Commited+ 낙관적 락을 사용하는 방법도 부분적으로 필요하겠다는 생각이 드네요..!
Version2로 각각 구현해보고 나중에 테스트해보겠습니다..
코드의 흐름은 비슷해서 리뷰할 내용은 거의 없습니다!
세션을 통한 로그인 방법은 저도 추후에 공부해서 적용해보겠습니다 :) 너무 잘 구현해 두셔서 참고할께요!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
테스트 코드 작성하신 방법 참고해서 테스트 코드 작성해 보겠습니다..! Good... 👍



회원
계좌