Skip to content

Commit

Permalink
fix : 락 모드 변경
Browse files Browse the repository at this point in the history
- 순차적인 쓰기를 위한 락 모드 변경 (읽기락 -> 쓰기락)
  • Loading branch information
seokho-1116 committed Jun 2, 2024
1 parent 0207f90 commit 2c7119d
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public interface FriendInviteRepository extends Repository<FriendInvite, Long>,

void delete(FriendInvite friendInvite);

@Lock(LockModeType.READ)
@Lock(LockModeType.PESSIMISTIC_WRITE)
@QueryHints({@QueryHint(name = "jakarta.persistence.lock.timeout", value = "3000")})
Optional<FriendInvite> findFriendSendingInviteForUpdateByOwnerIdAndFriendId(Long memberId,
Long friendId);
Expand All @@ -30,7 +30,7 @@ Optional<FriendInvite> findFriendSendingInviteForUpdateByOwnerIdAndFriendId(Long
join fetch fi.friend
where fi.owner.id =:friendId and fi.friend.id =:memberId
""")
@Lock(LockModeType.READ)
@Lock(LockModeType.PESSIMISTIC_WRITE)
@QueryHints({@QueryHint(name = "jakarta.persistence.lock.timeout", value = "3000")})
Optional<FriendInvite> findFriendReceptionInviteForUpdateByOwnerIdAndFriendId(
@Param(value = "memberId") Long memberId,
Expand Down

0 comments on commit 2c7119d

Please sign in to comment.