Multiple user updating inventory qty with deluge

Multiple user updating inventory qty with deluge

Hi all, i have a scenario below

I have a inventory product A with qty 10 and there are three users submit their order at the same time.

user A ordered 10
user B ordered 10
user C ordered 10

i have script on validate to check if the qty goes less than 0, stop submission and prompt alert. And a script to deduct the qty from inventory upon success submission.

but for the scenario above, the inventory Product A qty came back as 0 sometime return as negative 10 or negative 20( i have tried multiple times) which is not correct, it seems the request submitted has no queue on the server side and it will process simultaneously.

this is a very serious issue, any of you facing the same?

thanks

TD