Suppose in a website like flipcart how can we control a product being purchased by 2 users if there is only one product available for sell .
is there any locking mechanism ?please let me know the logic .Thanks in advance.