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

spring data mongo를 사용할때 낙관락 이슈 #5

Open
saechimdaeki opened this issue Feb 12, 2024 · 0 comments
Open

spring data mongo를 사용할때 낙관락 이슈 #5

saechimdaeki opened this issue Feb 12, 2024 · 0 comments

Comments

@saechimdaeki
Copy link
Owner

궁금증

회사에서 mongodb를 특정ID(PK가 아닌)로 조회 후 없다면 생성후 저장하는 로직이 있는데 duplicated key exception이 발생하였다

mongoDB를 단순 저장하는 기능은 upsert기능을 제공할텐데 왜 그럴까?

결론

결론은 @Version에 관련된 이슈가 존재했다

해당 관련된 이슈들은 어느 정도 알려진 이슈였음

Persistable을 구현하였고 isNew() 메소드를 직접 구현하여 해결

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant