Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Distributed Applications / February 2004

Tip: Looking for answers? Try searching our database.

Concurrency management

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
moko - 02 Feb 2004 10:07 GMT
How is concurrency managed in a typical .NET application ? What about
optimistic and pessimistic locking ?
Maxim V. Karpov - 02 Feb 2004 13:39 GMT
Moko,
This is very good question. If you use ADO.NET then Optimitic Locking is
the ONLY choice I recommend using.
Concurrency Management is two fold:
1. Detecting
   a. Primary Key + all the fields
   b. Primary Key only - last wins
   c Primary Key + fields that been updated
   d. Primary Key and Timestamp or Rowversion
2. Resolving
   a. On the Server (Automatic)
   b. On The client (Manual)

ADO.NET provides this functionlity with Data Adapter and Dataset (Data
Mapper Pattern - http://ipattern.com/simpleblog/PermLink.aspx?entryid=14) .
DataSet object can contains Original and Current Version of values per Row,
so conflit resolution will happen on Per row basis.

You can use CommandBuilder or Data Adapter Wizard that will generates SQL
for you with some limits because It does not support BLOB in WHERE clause;
therefore you have to write your own SP or SQL to support  (D) option of
detecting.

I hope this provides you at least with a some guideline.

Maxim

[www.ipattern.com do you?]
> How is concurrency managed in a typical .NET application ? What about
> optimistic and pessimistic locking ?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.