Say I was to offer an item to multiple users, up to a maximum of say 10 purchases can be made by any user until the item is 'deactivated'. The items are taken from the mainitems table and filtered to the specific users.
For each purchase a count is incremented in the items row to indicate the amount of purchases made. How can I control say 11 users all trying to purchase this item @ once? Is the best way to acheive this by simply locking that row until the purchase is completed and then compared? Or is there a way I can do this without having to constantly remove the results from other users and then reactivating them?