-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[test] photo_request 테이블에 비관적 락을 적용해 동시성 문제 해결하기
- Loading branch information
Showing
4 changed files
with
13 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
비관적 락은 데이터베이스의 락 기능을 이용하는 것입니다. 동시에 같은 레코드에 접근할 것으로 예상되는 곳에
@Lock(LockModeType.PESSIMISTIC_WRITE)
를 걸어서 비관적 락을 적용합니다.기존에는 save 시에 select - update가 이루어졌다면, 비관적 락을 사용하면 select for update - update가 이루어져 조회 시에도 레코드에 배타적 잠금을 걸 수 있습니다.