There are many possibilities.
[opinion: I think most web applications do optimistic concurrency handling]:
A good tutorial on optimistic concurrency processing is here: http://msdn.microsoft.com/en-us/library/bb404102.aspx
Small annotation:
Similarly, when two users visit a page, one user may be in the middle of updating a record when it is deleted by another user. Or, meanwhile, when the user loads the page, and when they click the "Delete" button, another user can change the contents of this entry.
There are three concurrency -control strategies available:
- Nothing to do. If concurrent users modify the same record, let the last win fix (default behavior). β’
- Optimistic concurrency - Suppose that although concurrency conflicts may exist from time to time, in most cases such conflicts do not occur; therefore, if a conflict arises, simply inform the user that their changes cannot be saved because another user has changed the same data.
- Pessimistic concurrency - Assume that concurrency conflicts are common and that users will not tolerate reporting that their changes have not been saved due to other simultaneous user activity; therefore, when one user starts to update the record, blocks it, thereby preventing other users from editing or deleting this record until the user makes his changes.
Pleun source share