Re: Optimistic Concurrency - how? - net 2.0
- From: "William \(Bill\) Vaughn" <billvaRemoveThis@xxxxxxxxx>
- Date: Wed, 2 May 2007 17:28:41 -0700
I don't know what books you've read but there are those that can supply
enough information to permit you to build your own concurrency handler--mine
is one of those. I don't know that anyone would be willing to just "give"
you a complete solution--not even a hungry author. That's because these are
the mother's milk of many custom applications. While my books discuss the
issues involved and illustrate a number of ways to address the issues, it
(like many other books) does not provide a canned solution. One of the
(many) problems has more to do with how you approach concurrency. I for one
don't recommend building applications whose data access schemes are designed
to "collide" and require code to pick up the pieces after the collision.
It's like building automobile intersections without traffic signals but with
strategically placed ambulances and wreckers to clean up the mess after the
expected collisions.
I suggest setting up a data access scheme where two users are not at all
likely to address the same row at the same time. If one looks at many
designs, it turns out that there are fairly easily managed ways to avoid
collisions.
In any case, the basics involve deciding what should happen when two (or
more) clients change the same row at the same time. Generally there are
several approaches (that I discuss in my book) that either let the last
change go through (the brute force method), the "timid" method that just
accepts any changes made by other users or the arbitration method that tries
to figure out which update to accept. The first two are easy to
implement--one leaves the concurrency check off the WHERE clause in the
UPDATE, the second does the same but reads back the row to determine the
current state. The last approach is very hard to implement with systems that
have to scale beyond a few users as it often requires the user to determine
how to proceed. This can lock up a system in no-time if you aren't
careful--and even if you are...
Once you've started to look at concurrency be sure to study replication and
synchronization that handles concurrency in an entirely different way.
hth
--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
-----------------------------------------------------------------------------------------------------------------------
"Rolf Welskes" <rolf@xxxxxxxxxxxxx> wrote in message
news:%23Ih8a3QjHHA.4520@xxxxxxxxxxxxxxxxxxxxxxx
Hello,
I have the situation that many users on the same db , table have access
and make changes.
Ok for this there is optimistic concurrency.
So I am able to check for cocurrency and get (in the moment) a messagebox,
which says
that there is a concurrency violation.
I have searched in MSDN and have many books about ado net 2.0,
but how to work REALY with optimistic concurrency no one says,
only in msdn is a small article with the absolute minimum to know.
Means, I can check and see that a concurrency violation is present,
but what now.
The user gets a messagebox: Data are not saved - Error.
No normal user for example a book keeper knows what to do.
I do no know how to hande such situations in details,
for example show the data or give a hint to do what ever.
It would be very helpful to have some full working examples for
a database which implements optimistic concurrency.
If there is anything, please send me links to it.
Thank you for any help.
Rolf Welskes
.
- References:
- Optimistic Concurrency - how? - net 2.0
- From: Rolf Welskes
- Optimistic Concurrency - how? - net 2.0
- Prev by Date: Optimistic Concurrency - how? - net 2.0
- Next by Date: Re: Still trying to read descriptions for tables, columns, etc from me
- Previous by thread: Optimistic Concurrency - how? - net 2.0
- Next by thread: Re: Optimistic Concurrency - how? - net 2.0
- Index(es):
Relevant Pages
|