How can I handle concurrency issues for an asp.net 4.5 web application (VS2012 and C#, SQL Server)
For example:
My scenario is a user might have a chance that is never able to process a queue item. See the following:
- User A opens the queue item (a), review it carefully
- User B opens the queue item (a), processes it without reviewing
- User A decides to process (a), but it's locked, so jumps to item (b)
- User C opens the queue item (b), processes it immediately
- User A decides to process (b), but it's locked again
- the same thing happens forever towards user A
That will not be ideal for the user A, even though the percentage of this possibility could be really small
I am using transactions at the C# code level as well as at the SQL Server stored procedure level. Also I make use of ADO.net to communicate with database
My questions are:
- do you think creating transactions will take care of concurrency issues ?
- I am guessing ADO.net has built in concurrency prevention in place? Am I correct ?
- do I need to do anything else to prevent concurrency issues other than creating transactions and using ADO.net?