Cannot DELETE a record from work area

This forum is meant for questions about the Visual FoxPro Language support in X#.

User avatar
robert
Posts: 4267
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

Cannot DELETE a record from work area

Post by robert »

Thomas,

The support for buffered updates, combined with its support functions OldVal(), TableUpdate(), the functions you mentioned etc. are on our todo list for one of the coming builds.

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
mainhatten
Posts: 200
Joined: Wed Oct 09, 2019 6:51 pm

Cannot DELETE a record from work area

Post by mainhatten »

lumberjack wrote:It was always at our conferences emphasized how to manage multi-user systems and the one that was repeated over and over again, generic RLock()/UnLock functions/methods.
Johan,

If your App needs it, you can always RLock() before editing, which carries its own pitfalls. But I think MS range of option for handling update conflict is good enough for optimistic locking to prevail over pessimistic (which they offer in buffering as well).

Best practices might have been explained in more detail ;-)

regards
thomas
User avatar
lumberjack
Posts: 723
Joined: Fri Sep 25, 2015 3:11 pm
Location: South Africa

Cannot DELETE a record from work area

Post by lumberjack »

Hi Thomas,
mainhatten wrote: If your App needs it, you can always RLock() before editing, which carries its own pitfalls. But I think MS range of option for handling update conflict is good enough for optimistic locking to prevail over pessimistic (which they offer in buffering as well).
Best practices might have been explained in more detail ;-)
I have done all my programming in a wrapper class Insert/Update/Delete in a Scatter/Gather method and they all basically called the NetTry function that I have shared a couple of days before, nothing fancy but it is solid and I have not touched them since the late '90s. Work even for standalone systems as well as multi-user client server. Less than 100 lines of code.
______________________
Johan Nel
Boshof, South Africa
mainhatten
Posts: 200
Joined: Wed Oct 09, 2019 6:51 pm

Cannot DELETE a record from work area

Post by mainhatten »

Hi Johan,
lumberjack wrote:I have done all my programming in a wrapper class Insert/Update/Delete in a Scatter/Gather method and they all basically called the NetTry function that I have shared a couple of days before, nothing fancy but it is solid and I have not touched them since the late '90s. Work even for standalone systems as well as multi-user client server. Less than 100 lines of code.
Certainly not rocket science, but you will run into edge cases where the pessimistic locked records are locked during a telephone call expected to be over in 2 minutes but took 52... I think MS nailed a good default if you have trustable ts_update or better i8_recwrite counter fields which can guarantee optimized access on bulk operations.

regards
thomas
User avatar
lumberjack
Posts: 723
Joined: Fri Sep 25, 2015 3:11 pm
Location: South Africa

Cannot DELETE a record from work area

Post by lumberjack »

Thomas,
mainhatten wrote: Certainly not rocket science, but you will run into edge cases where the pessimistic locked records are locked during a telephone call expected to be over in 2 minutes but took 52... I think MS nailed a good default if you have trustable ts_update or better i8_recwrite counter fields which can guarantee optimized access on bulk operations.
Well it is a coding style, you can sit a year on a record in my applications and it won't matter. Very similar approach to MS on my DBFs, not that I use DBF anymore though.
______________________
Johan Nel
Boshof, South Africa
Karl-Heinz
Posts: 774
Joined: Wed May 17, 2017 8:50 am
Location: Germany

Cannot DELETE a record from work area

Post by Karl-Heinz »

Guys,

The VO DbServer class knows the locking mode CC_OPTIMISTIC. That means - from what i heard ;-) - that the locking and replacement is made automatically. I only used CC_NONE. That means, that i´m alone responsible for the locking and replacement. Freely adopted from what Karl Lagerfeld once said: "If you´ve lost the control of your data dependecies, you have lost the control of your live[strike][/strike]" :)

regards
Karl-Heinz
mainhatten
Posts: 200
Joined: Wed Oct 09, 2019 6:51 pm

Cannot DELETE a record from work area

Post by mainhatten »

Hi Johan,
lumberjack wrote:Well it is a coding style, you can sit a year on a record in my applications and it won't matter. Very similar approach to MS on my DBFs, not that I use DBF anymore though.
For client side stuff I prefer DBF to other formats - as long as no crypto is needed. Saving numerics in binary is main reason over SQLite, portability another. Too bad there is not enough standardization in header/data formats, IMO it would have been a better transmission protocol compared to XML and even JSON, as reading effort takes less computing power.
Multiuser remote access since SMB2 impossible for any SW unless self-used (to take blame)

Yes, it is a matter of use case and style - my reason to only point to IMO "sane defaults".

regards
thomas
FFF
Posts: 1532
Joined: Fri Sep 25, 2015 4:52 pm
Location: Germany

Cannot DELETE a record from work area

Post by FFF »

lumberjack wrote: not that I use DBF anymore though.
Would love to see a "VO-StandardMDI"-Sample, backed by a PG-backend in the Gallery :whistle: .
Regards
Karl
(on Win8.1/64, Xide32 2.19, X#2.19.0.2.)
User avatar
lumberjack
Posts: 723
Joined: Fri Sep 25, 2015 3:11 pm
Location: South Africa

Cannot DELETE a record from work area

Post by lumberjack »

Hi Karl,
FFF wrote:
lumberjack wrote: not that I use DBF anymore though.
Would love to see a "VO-StandardMDI"-Sample, backed by a PG-backend in the Gallery :whistle: .
Your :whistle: from long ago is in the back of my mind. I am not too far away from my next DataDriven article publication, so maybe inside of that you will see a sort of ADO.NET MDI application taking shape.
______________________
Johan Nel
Boshof, South Africa
Post Reply