Concurrency checking data in request form #48326
Unanswered
MostafaRabia
asked this question in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
HI
What about you need to checking if data is exist with your additional where and make sure that there are no race condition?
like:
'item' => [ Rule::exists('items', 'id')->where('is_available', true) ]
and you are using
lockForUpdate
in your code for making sure that there is no one showing this item until it releaseIf there are 2 choosed the same item, they are both will pass the request form, and one of them will be stuck waiting the another to be finished
So, what about using
lockForUpdate
in theRule
itself? so he won't pass the request form and showing that the item is not available anymoreThanks
Beta Was this translation helpful? Give feedback.
All reactions