Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VB, C#, and VFP data handling examples
Message
From
22/04/2007 21:28:56
John Ryan
Captain-Cooker Appreciation Society
Taumata Whakatangi ..., New Zealand
 
 
To
22/04/2007 20:51:19
General information
Forum:
Visual FoxPro
Category:
Visual FoxPro and .NET
Miscellaneous
Thread ID:
01215120
Message ID:
01218740
Views:
23
We pass DataSets around (or as an XML string through the Web Service layer, although not as a DiffGram) ... we use GetChanges() to only pass the changed stuff back through the Web Service to the DataAccess, so that only changed rows get updated.

Cool! So where do you keep the update code- in a partial class for the DataSet or ??

Up until now, we haven't had to worry about using any kind of locking mechanism ... the nature of our application was such that it was good enough that when changes were saved, the last one saved was the winner.

I think that's fair enough- if 2 users edit the same field at once, most often it'll be reasonable to accept both saves (as long as that's all you save- i.e. you don't save every field.) IMHO change tracking with this principle is not more difficult than rolling your own pessimistic locking and saving every field every time.

Now however, with some new apps we're in the process of developing, we *are* going to have to worry about it. We are planning on implementing semaphore locking, but haven't gotten that far into it yet.

Could you avoid locking by crafting a SQL update whose WHERE clause specifies the original values of critical fields that have been edited? Then the update will fail if a critical field has been edited by another user, in which case you can pull newer values and get the user to adjudicate. I suppose it depends on whether the customer wants the second user to adjudicate or whether they're happy to queue edits. If you do queue, once user1 finishes, IMHO user2 is going to go right ahead and edit the fields they want whether user1 edited them or not, so you might as well let them both get on with it!
"... They ne'er cared for us
yet: suffer us to famish, and their store-houses
crammed with grain; make edicts for usury, to
support usurers; repeal daily any wholesome act
established against the rich, and provide more
piercing statutes daily, to chain up and restrain
the poor. If the wars eat us not up, they will; and
there's all the love they bear us.
"
-- Shakespeare: Coriolanus, Act 1, scene 1
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform