I have a model say
Then I have about 150 simultaneous requests coming to my Laravel app endpoint say
In that request I select the oldest apple and assign it to the
The problem I'm having is due to the high number of requests some
Bushels are grabbing the same
How can I make sure that the one I grab will not be grabbed by anything else.
I've tried things like:
lockForUpdate(which i don't believe I'm using correctly)
Whats the best solution for this case?