vendredi 1 mai 2015

Assign Item ID before submit with multiple users

I have an ASP.NET Web Forms web application. Users can submit new requests through the system. When a user open a request form it should display the request number in the request interface.

request number is similar to the request number in the database which is a auto increment field in the database starting from 1. So when a user open a new request form, it checks for the max request number in the database table and add +1 to the number and display it as the request id for the new request. This method was successful until few users were using it.

But when the number of users increased I faced this problem. When two users trying to add a new request at the same time they both receive the same request number. So now I need to handle this issue. What is the best approach to handle this issue? Any suggestions and clues are highly appreciated. Thanks.




Aucun commentaire:

Enregistrer un commentaire