Skip to content

Conversation

20HyeonsuLee
Copy link

@20HyeonsuLee 20HyeonsuLee commented Oct 18, 2025

안녕하세요 아마~

이번에도 리뷰 잘부탁드립니다!

@20HyeonsuLee 20HyeonsuLee requested a review from Astro-Yu October 18, 2025 13:43
@20HyeonsuLee 20HyeonsuLee self-assigned this Oct 18, 2025
@20HyeonsuLee 20HyeonsuLee changed the base branch from main to 20hyeonsulee October 18, 2025 13:44
@coderabbitai
Copy link

coderabbitai bot commented Oct 18, 2025

Warning

Rate limit exceeded

@20HyeonsuLee has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 15 minutes and 30 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between d934a13 and 6cba3d5.

📒 Files selected for processing (9)
  • app/src/main/java/com/techcourse/dao/UserDao.java (0 hunks)
  • app/src/main/java/com/techcourse/dao/UserHistoryDao.java (0 hunks)
  • app/src/main/java/com/techcourse/service/AppUserService.java (1 hunks)
  • app/src/main/java/com/techcourse/service/TxUserService.java (1 hunks)
  • app/src/main/java/com/techcourse/service/UserService.java (1 hunks)
  • app/src/test/java/com/techcourse/service/MockUserHistoryDao.java (2 hunks)
  • app/src/test/java/com/techcourse/service/UserServiceTest.java (2 hunks)
  • jdbc/src/main/java/com/interface21/jdbc/core/JdbcTemplate.java (5 hunks)
  • jdbc/src/main/java/com/interface21/transaction/support/TransactionSynchronizationManager.java (1 hunks)

요약

이 변경사항은 수동 JDBC 기반 데이터 액세스를 JdbcTemplate 기반으로 마이그레이션하는 포괄적인 리팩토링입니다. UserDao와 UserHistoryDao를 JdbcTemplate을 사용하도록 업데이트하고, 조회 메서드의 반환 타입을 Optional로 변경했습니다. UserService는 DataSource를 추가로 수용하여 명시적 트랜잭션 관리를 지원합니다. JdbcTemplate에 매개변수화된 쿼리와 행 매핑을 위한 새로운 공개 API 메서드를 추가했고, RowMapper 인터페이스를 도입했습니다. 테스트 인프라를 업데이트하고 DatabaseInitializer 유틸리티 클래스를 추가했으며, JUnit 5 의존성을 포함시켰습니다.

Pre-merge checks

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Description Check ❓ Inconclusive PR 설명이 작성되지 않았습니다. 설명이 없으므로 changeset과의 관련성을 평가할 수 없습니다. 설명이 존재하지 않는 경우, 변경 사항과 "어떤 방식으로든 관련"되어 있다고 할 수 없으며, 이는 극도로 모호한 상태입니다. PR 설명을 추가하여 변경 사항의 목적과 범위를 설명하기를 권장합니다. 예를 들어 JdbcTemplate 도입, 트랜잭션 관리 구현, Optional 도입 등의 주요 변경 사항과 이들의 의도를 설명하면 리뷰어가 더 쉽게 이해할 수 있습니다.
✅ Passed checks (1 passed)
Check name Status Explanation
Title Check ✅ Passed PR 제목 "[4단계 - Transaction synchronization 적용하기]"는 변경 사항의 일부를 설명합니다. UserService.java에서 실제로 명시적인 트랜잭션 관리가 추가되었고, changePassword 메서드에서 Connection을 획득하여 commit/rollback 처리가 구현되었습니다. 그러나 전체 changeset의 가장 광범위한 변경은 DataSource 기반의 JDBC 코드를 JdbcTemplate으로 마이그레이션하는 것이며, 이는 제목에 반영되지 않았습니다. 제목은 변경의 실제 일부 측면을 정확히 가리키지만 가장 주요한 변경을 대표하지는 않습니다.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@Astro-Yu Astro-Yu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

안녕하세요 한스~ Step4 멋진 코드 잘 봤습니다! hasConnection 으로 먼저 커넥션을 확인한 후 로직 진행하는 부분 배워갑니다 ㅎㅎ

추가적으로 리뷰 남겼으니 한번 확인해주시죠! 또 더 의논하고 싶은 부분이 있다면 말씀해주세요.
수고하셨습니다!

Comment on lines +29 to +31
if (resources.get() == null) {
resources.set(new HashMap<>());
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P5: LocalThread에는 최초 선언시 값을 초기화 할 수 있는 함수가 있는 것 같아요. 대신 사용해보면 어떨까요??

Comment on lines +36 to +40
try {
connection.rollback();
} catch (SQLException ex) {
throw new RuntimeException(ex);
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: 이 부분에서 rollback 시 예외가 발생한다면 원본 예외(Exception e)가 덮어 씌워지는데 어떤가요? 만약 changePassword에서 NPE가 발생하고, 롤백 시 예외가 발생한다면 NPE는 알 수 없게 될 것 같아요.

Comment on lines +27 to +46

public void changePassword(final long id, final String newPassword, final String createBy) {
final DataSource dataSource = DataSourceConfig.getInstance();
final Connection connection = DataSourceUtils.getConnection(dataSource);
try {
connection.setAutoCommit(false);
userService.changePassword(id, newPassword, createBy);
connection.commit();
} catch (Exception e) {
try {
connection.rollback();
} catch (SQLException ex) {
throw new RuntimeException(ex);
}
throw new DataAccessException(e);
} finally {
DataSourceUtils.releaseConnection(connection, dataSource);
TransactionSynchronizationManager.unbindResource(dataSource);
}
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P5: 이 코드의 종착지는 아시죠? AOP도 배워봤으니, 시간 되실때 어노테이션으로 구현해보는것도 추천드립니다. 이번주는 바쁘니 넘어가시죠 ㅎㅎ

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants