Concurrency in ADO.NET

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi all

We´re developing an application will have a lot of concurrent users. I want to know what´s he best way to give a solution to this problem in .NET. Any idea will be appreciated

Thanks a lot.
 
Within the DataSet, you have a variety of types of rows. Concurrency can be
handled on update, as the DataAdapter will find changed data and alert you
of problem rows.

Note: the less data changed per transaction, the less likely to hit a lot of
concurrency issues (ie, if someone edits one record and saves, concurrency
problems are lower than editing hundreds of rows offline and then saving).

Dino Esposito has written quite a bit of material on ADO.NET, including
articles (and chapters) on data concurrency. Consult his articles on MSDN
and consider his ADO.NET/ASP.NET book from last year.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

************************************************
Think Outside the Box!
************************************************
otto said:
Hi all:

We´re developing an application will have a lot of concurrent users. I
want to know what´s he best way to give a solution to this problem in .NET.
Any idea will be appreciated.
 
There is no one size fits all answer. If you use the commandbuilder, you are
really limited. If you roll your own logic you have full control over it.

Basically you can determine what conditions you'll want to throw an
concurrency exception if you roll your own logic. You can trap and respond
to concurrency excpetions however you want.

If you use the Configuration wizard, you can turn off Optimistic
concurrency, and for a learning experience, I'd encourage you to configure
an adapter with OC on and off and see the different code that's generated.
If you use a COmmandBuilder, if Any value changes you'll get a concurrency
exception. If you use your own, you can trap the exception and ask the user
what they want or implement whatever business rule is in place.

In some instances last in wins is best. In a hospital envrironment, someone
may well die if you do this... so there really isn't a 'best'

If you have some specifics I'll be glad to address them with you.

HTH,

Bill

www.devbuzz.com
www.knowdotnet.com

otto said:
Hi all:

We´re developing an application will have a lot of concurrent users. I
want to know what´s he best way to give a solution to this problem in .NET.
Any idea will be appreciated.
 
otto, I would recommend reading ADO.NET - David Sceppa. He explains
concurrency rather well with some really practical examples. I know of a
company that has tweaked his optimistic concurrency model to wildly
optimistic concurrency (long story), to suit their needs.

- Sahil Malik
Independent Consultant
You can reach me thru my blog at -
http://www.dotnetjunkies.com/weblog/sahilmalik/
 
Back
Top