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 / ADO.NET / March 2008

Tip: Looking for answers? Try searching our database.

Reference database application request

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
John - 08 Mar 2008 20:43 GMT
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
Cor Ligthert[MVP] - 09 Mar 2008 13:27 GMT
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

> Hi
>
[quoted text clipped - 5 lines]
>
> Regards
John - 09 Mar 2008 15:04 GMT
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

> John,
>
[quoted text clipped - 18 lines]
>>
>> Regards
Steve Gerrard - 09 Mar 2008 16:57 GMT
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.

> 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
[quoted text clipped - 25 lines]
>>>
>>> Regards
John - 09 Mar 2008 17:18 GMT
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

> 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
[quoted text clipped - 39 lines]
>>>>
>>>> Regards
Steve Gerrard - 09 Mar 2008 18:06 GMT
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.

> Hi Steve
>
[quoted text clipped - 13 lines]
>> means the update will only update if the underlying data has not
>> changed in the meantime.
Cor Ligthert[MVP] - 09 Mar 2008 18:26 GMT
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

> Hi Steve
>
[quoted text clipped - 51 lines]
>>>>>
>>>>> Regards

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.