[JDBC 라이브러리 구현하기 - 3단계] 성하(김성훈) 미션 제출합니다. #425
Merged
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.
안녕하세요! 루쿠! 성하입니다! 👋🏻
이번 3단계에서는 UserService에 Transaction을 적용해봤습니다!
UserDao와 UserHistoryDao의 로직 중 하나라도 실패하면 롤백이 되도록 해야 했는데요!
그래서 UserDao와 UserHistoryDao가 동일한 Connection 객체를 사용해야 했고,
동일한 Connection 객체를 사용하기 위해
메소드를 오버로딩하여 Connection을 파라미터로 받아서 동일한 Connection을 넣어주게 되었습니다!
현재 서비스 코드에서 Connection 객체가 사용되어 비즈니스 로직과 섞이고 있지만
이후 4단계 미션 요구사항을 지키다보면 분리될 것 같아서 3단계는 이렇게 제출하겠습니다!!
리뷰 잘 부탁드려요 루쿠! 👍🏻