Therefore, in situations where pessimistic concurrency is used, there's typically a timeout that, if reached, cancels the lock.
Ticket sales websites, which lock a particular seating location for short period while the user completes the order process, is an example of pessimistic concurrency control.
In the first screen, we're prompted to specify the database to connect to - connect to the same Northwind database using the .
Figure 4: Specify the Data to Retrieve Using an Ad-Hoc SQL Statement (Click to view full-size image) On the following screen, enter the SQL query to use to retrieve the product information. Discontinued = discontinued End Sub _ Public Function Update Product( By Val product Name As String, By Val supplier ID As Nullable(Of Integer), _ By Val category ID As Nullable(Of Integer), By Val quantity Per Unit As String, _ By Val unit Price As Nullable(Of Decimal), By Val units In Stock As Nullable(Of Short), _ By Val units On Order As Nullable(Of Short), By Val reorder Level As Nullable(Of Short), _ By Val discontinued As Boolean, By Val product ID As Integer, _ _ By Val original_product Name As String, _ By Val original_supplier ID As Nullable(Of Integer), _ By Val original_category ID As Nullable(Of Integer), _ By Val original_quantity Per Unit As String, _ By Val original_unit Price As Nullable(Of Decimal), _ By Val original_units In Stock As Nullable(Of Short), _ By Val original_units On Order As Nullable(Of Short), _ By Val original_reorder Level As Nullable(Of Short), _ By Val original_discontinued As Boolean, _ By Val original_product ID As Integer) _ As Boolean ' STEP 1: Read in the current database product information Dim products As _ Northwind Optimistic Concurrency.For a web application that allows multiple users to edit data, there is the risk that two users may be editing the same data at the same time.In this tutorial we'll implement optimistic concurrency control to handle this risk.For web applications that only allow users to view data, or for those that include only a single user who can modify data, there's no threat of two concurrent users accidentally overwriting one another's changes.For web applications that allow multiple users to update or delete data, however, there's the potential for one user's modifications to clash with another concurrent user's.