How do you do locking in ADO.Net?

Locking can be handled at ADO.Net side or at SQL Server side i.e., in stored procedures. When we call Update method of DataAdapter it handles locking internally.

We have two types of locking…

  • Optimistic Locking:    When multiple users can open the same record for updating, then the record is locked when updating the record in Optimistic locking. Now a days web based applications are very common so this is the most preferred way of locking.
  • Pessimistic locking:    When user wants to update data it locks the record and till then no one can update data. Remaining users can only view the data.

0 comments :

Post a Comment

> Related Posts with Thumbnails
 

Copyright © 2012. GS dot net - All Rights Reserved - Design by BTDesigner - Proudly powered by Blogger