Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 투표와 댓글 추가 시 낙관적 락 사용한다 #194

Merged
merged 3 commits into from
Mar 27, 2024

Conversation

melonturtle
Copy link
Contributor

@melonturtle melonturtle commented Mar 14, 2024

What is this PR? 🔍

  • 투표와 댓글 추가 시 낙관적 락 사용하여 DB에 다른 트랜잭션이 이미 업데이트 했으면 exception 발생하도록 수정했습니다.
  • 저번에 말씀드린 비관적 락 방법도 있겠지만, 아직 유저가 많지 않은데 비관적 락을 사용하면 이득이 그만큼 없을 것 같아서, 일단 수정 후 문제가 발생하면 exception 발생하여 클라이언트에서 처리하도록 하는 편이 좋다고 생각해서 이 방법으로 구현했습니다.
  • 이것도 역시 자세한건 정리했어용: 블로그
    • 낙관적 락이나 비관적 락 말고 또 다른 방법도 적어놨는데, 해당 부분 코드는 concurrency/count/query 브랜치에 있습니다. 이 방법이 더 좋은 것 같으면 의견 주세요!

🛠️ Issue

@melonturtle melonturtle requested a review from 60jong March 14, 2024 17:10
@melonturtle melonturtle merged commit 4c56f55 into main Mar 27, 2024
1 check passed
@melonturtle melonturtle deleted the concurrency/count/optimistic branch March 27, 2024 12:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

동시에 댓글 추가될 때 count 반영 안됨 동시에 투표시 count 반영 안됨
1 participant