adspace


Dataset is the disconnected environment. suppose if you are binding records to gridview (disconnected environment) and you are making changes to the the grid but before updating the database if any other user modify the data, how will you avoid such problem?

Answer Posted / Kuvar Sen

In a disconnected environment where multiple users can modify data independently, implementing concurrency control mechanisms is essential to prevent conflicts. To avoid issues with simultaneous modifications, consider the following strategies:
1. Optimistic Concurrency Control (OCC): This approach assumes that conflicts are rare and checks for changes made by other users before saving the updates. You can use a version number or timestamp to identify modified records. If the record has been updated since it was last retrieved, an error is thrown, and the user must refresh the data and retry the operation.
2. Pessimistic Concurrency Control (PCC): This approach assumes that conflicts are common and locks records while they are being edited to prevent other users from modifying them simultaneously. When a user wants to make changes, the record is locked until the update is committed or rolled back. This can lead to decreased concurrency and increased lock contention.
3. Use of transactions: Ensuring that all database operations are grouped into a transaction can help maintain data consistency by either committing all changes at once or rolling back all changes if an error occurs.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

a web application needs to be created to accept the product name and quantity of a toy from a customer. After the customer has entered the product name the application needs to display the discounted price of the product to the customer (company is offering 35% discount on all products). The application should allow the customer to select the product name from a list box. and also while i'm data binding to a label with custom data binding with some declarations : "The Discounted Price is "+((System.Convert.todouble(lblprodprice.text)*(system.convert.todouble(txtqty.text)) - ((System.convert.todouble(lblprodprice.text)*(system.convert.todouble(txtqty.text)*0.35)). Where i need to give this declaration in asp.net 2.0.

1890


hi .net gurus. plz if any one has dumps on 70-631 and 70-541 on windows sharepoint services kindly mail me.

1714


What do you mean by query string?

1011