Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
My app may be upsized one day. Should I use pessimistic
Message
 
 
To
22/11/2000 08:29:12
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00444072
Message ID:
00444558
Views:
8
>Thanks Jim
>
>
>>Use optimistic as it will force you to address the issues related to it. There is no such thing as pessimistic when using a backend server.
>
>
>The issue I am trying to address at the moment is how to delete an invoice from the SQL server.
>
>If user1 deletes the record but user2 already has a copy of that record in their buffer then the record will be saved again when user2 commits the changes.
>
>I presume that I have to write code that notices this is what has happened and tells user2 that another user deleted the existing record.
>
>Am I right about this

Mark,
It won't be saved again. When the second user attempts a Tableupdate to write their changes to the table, it will return .F. because user 1 already changed the record in some way (in this case, they deleted it). You then need to process the return of aerror() to determine why it failed and act accordingly.

Note: Be sure to wrap your tableupdates in a transaction so if something does fail, you can rollback everything.
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Previous
Reply
Map
View

Click here to load this message in the networking platform