LeaseTime 초과 시 트랜잭션 롤백하도록 수정 #46
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.
변경사항
상세내용
AopForTransaction에@Transactional어노테이션 대신PlatformTransactionManager를 직접 사용함으로써 트랜잭션이 LeaseTime보다 길게 수행되는 경우 해당 트랜잭션을 롤백하고 롤백 완료 시 락을 해제하도록 개선예시
기존 : A 트랜잭션 수행 도중 분산락 임대 시간 초과로 락 해제되면 B 트랜잭션에서 분산락 획득 및 Dirty Read 발생 가능
현재 : A 트랜잭션 수행 도중 임대 시간 초과되면 분산락을 유지한 상태로 트랜잭션 롤백 수행 -> B 트랜잭션은 락 획득 대기
연관 이슈