I have two requests A and B with the same user id that are being made at the same time.
The procedure for each request is simple and that is checking a status column indicating whether the request has been processed and if the value contains not processed, update the value to processed, and proceed.
Since request A and B both have the same user id, they will try to read and update the same row.
My expected behavior is either of request A and B would first update the status column, blocking the remaining request from being processed.
I am aware that mysql practices row-level locking but would there be a chance where both requests arriving at the same time would safely read the status column first and then update? Then, both of the requests would read status as not processed and hence proceed to being processed in the worst case.
Any insight would be much appreciated.