Groups | Blog | Home
all groups > dotnet ado.net > september 2007 >

dotnet ado.net : Optimistic Concurrency


Laurahn
9/7/2007 11:56:49 AM
Hi:

I need a easy way for handling optimistic concurrency.

I found this article with the code.
http://msdn2.microsoft.com/en-us/library/aa720364(VS.71).aspx

Here create both, new parameter value and old parameter value for the update
command.

I don't want to use the version number approach with TimeStamp field,
neither the data adapter configuration wizard.

Thanks.

Laura.

Kerry Moorman
9/7/2007 6:36:00 PM
Laura,

The article listed the 2 most common techniques:

1. Timestamps.
2. Verifying that all the original column values in a row still match those
found in the database.

What else are you looking for?

Kerry Moorman


[quoted text, click to view]
v-wywang NO[at]SPAM online.microsoft.com
9/10/2007 12:00:00 AM
Hello Laura,

The MSDN document provides a detailed sample about the technique of
verifying all the original column values.

For the technique about using timestamp column, you may refer the following
KB article:
http://support.microsoft.com/kb/309489
[HOW TO: Use a TimeStamp Column to Detect Update Collisions in ADO.NET with
Visual Basic .NET]

As far as I know, verifying TimeStamp filed is the simplest way for
Optimistic Concurrency.

Peter Bromberg has an article about Optimistic Concurrency Updating logic.
According to this document, another choice for us is to include the Primary
Key Columns and Modified Columns in WHERE case. But, I'm not sure if that
is suitable for your case.
http://www.eggheadcafe.com/articles/20050719.asp
[ADO.NET: Optimistic Concurrency Updating Logic]

Hope this helps. Please don't' hesitate to let me know if there is anything
we can help with. We are glad to assist you.
Best regards,

Wen Yuan
Microsoft Online Community Support
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
v-wywang NO[at]SPAM online.microsoft.com
9/12/2007 11:53:41 AM
Hello Laura,

This is Wen Yuan, again. I haven't heard from you a couple of days.
I just want to check if there is anything we can help with.

Please feel free to update here if you have any more concern. We are glad
to assist you.

Have a great day,
Best regards,

Wen Yuan
Microsoft Online Community Support
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
AddThis Social Bookmark Button