데이터소스 환경에 LazyConnection 프록시 적용 #72
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.



✨ 변경 사항
🔍 변경 이유
Thread 100개가 geohash 'wydm6' 문자열 내 다이어리 조회 부하 테스트를 걸어놓고 모니터링을 해보니 예상과는 다르게 DB connection을 모든 thread가 요청하고 있음
Spring에서 기본적으로 Transaction에 진입하는 순간, 설정된 DataSource의 connection을 바로 가져온다. 따라서 실제로 DB connection을 사용하고 있지 않는데도 계속해서 점유하고 있는 문제가 발생
LazyConnectionDataSource 사용하여 실제로 Connection이 필요한 시점에서야 DB connection을 획득하도록 요청
✅ 체크리스트
📸 스크린샷 (선택)
📌 참고 사항