Solve optimistic concurrency issue without adding a `version` field
Question
In the following page there is a suggestion how to solve concurrency issue by adding a
version
field and ask about it in the where
clause when updating a model:
Reference: https://www.prisma.io/docs/orm/prisma-client/queries/transactions#optimistic-concurrency-control
what I want to ask, is if instead of doing:
I could have asked if claimedBy is still null, will it do the same trick?
so the solution would be like so:
The only disadvantage compared to version is that if there were many swaps between claimedby and null, i would have not known about it, but that's fine by me I guess?1 Reply
?