Reference database application request

  • Thread starter Thread starter John
  • Start date Start date
J

John

Hi

I am looking for a sample master-detail database winform application that
handles multi-user issues like concurrency violations to inspect its code
for good db development practices. Would appreciate link to any such app.

Many Thanks

Regards
 
John,

For what you ask is no standard solution, the way it can be done has endless
possibilities.

A search for a good one which fits in your situation will be a lot in the
lottery.

You have to do it yourself, with first writing down what your policy will be
at a concurrency error.

Cor
 
Cor, anything that can get me started at a reasonably sane level is fine. I
am not looking for all possible ways to do things just any one way that does
it good enough.

Thanks

Regards
 
It seems to me that just running one of the gee-wizards to create a dataset and
tableadapter would tell you enough. Drag and drop, and click generate, and you
can see how MS sets up an update query to update the Authors table in
Biblio.mdb.

The strategy used is to pass the old value of every column as a parameter, along
with the new value of every column as a parameter. It then constructs a Where
clause in the SQL that checks that every old value is still there, or still null
as the case may be. That means the update will only update if the underlying
data has not changed in the meantime.

It is too awkward looking for my taste, I prefer using timestamps to keep track
of what has changed; but it is one way of getting it done.
 
Hi Steve

I know this much. I am looking to see how a detail-master app works
specially in terms of multi-user issues like concurrency violation handling.
It would be nice to see how a pro handles various real issues in a working
db app.

Thanks

Regards
 
I guess I'm not sure what you are expecting to find. The Where clause approach
described is one way of checking whether data has been changed by another user
before performing an update. Any approach to managing multi-user concurrency is
going to be along these lines, whether it uses timestamps, or a test of all data
columns, or some other mechanism. The only other option is to lock records at
the time they are retrieved, which is generally not a good idea.

If there are several tables involved in an update, the update can be wrapped in
a transaction, and you can add code to rollback the entire transaction if any of
the individual rows are not updated successfully. I'm not sure if you will find
a complete example of that anywhere, but you should be able to find examples of
using a transaction.
 
John,

As you have a concurrency violation (you can see that with a standard
dataadapter update on the returned errorstate of a datarow), then you have
some possibilites, however the first one is to show it to the user.

And then you can tell him to do it over again after you have got the new
values from the database.

You can show the new values and ask if it should be replaced by the just
typed ones and do that like this.

However all is up to you, don't think that this will happen often,
concurrency errors should be in most situations rare.

Cor
 
Back
Top