FrançaisEnglishEspañol
PC SOFTForums homeLast messagesOnline repository
PC SOFT
Find...
Perform the searchSearch in...
Newsgroup dedicated to WINDEV (current version), in English
[WD12] Record locking in HF Classic mode...
Mar., 15th 2010 at 01:14 PM
DarrenF
<gu...st@news.pcsoft.fr>


Hi all,
I'm back again... for some best practice advice on record locking. [[5]] Now that I've got to the bottom of my set-up issues and can now run my app over a network - yes, you've guessed it - I'd like to ask about how you guys handle record locking?
I'd like to use the standard WD record locking mechanism, but I think my customer will fall off his chair if/when he sees the standard WD locking message! He/they (won't mind me saying), are by no means technical! ;)
My maintenance options (to keep key/button presses to a minimum), issue a HReadSeek as soon as a row is selected in a table and promote the READ record to input (edit) fields ready for work. This means that if a table has rows in it (ie; there are rows on the DB), then that first row is considered locked for WRITE (hLockWrite?) and if a a different row is then selected by the user, then this would be READ and considered as locked for WRITE (unlocking the other record of course).
I've set my customers expectations; don't leave maintenance screens "just sitting there" with records selected etc...etc... as this may cause locks. We're all happy with this, so I can continue... ;)
Now, to test the locking, without adding any specific locking code, I started the same maint app on both networked PC's and amended the same record - I was allowed to amend the record that I'd already selected on the other PC - fair enough I thought - that just means by default it seems that "last modification wins"??? Is that true?
Then I added a hLockWrite to my HReadSeek in the Table (row selected) code. Ran the same maint app on both PC's again and selected a row from the Table - no problem there. Then selected a different row on the 2nd PC and got the standard WD message saying record was locked, even tho it wasn't selected on the other PC :confused:
a) I'm a little confused (as usual! ;) ), about the rules WD uses for locking.
b) Wondering what you guys do for record locking?
1) use the standard locking?
2) use the standard locking with some tweaks?
or 3) Completely re-write the locking mechanism to your liking?
Sorry about this being "long winded" again, but any discussions will be much appreciated...


Replies to this message:
Re: [WD12] Record locking in HF Classic mode...
Hi Al, Yes, as simple as possible if not simpler! ;) Plus, a bit of the problem was my understanding of how the mechanism works in practice :spos: My site is very understanding - I'm sure after I've d ...
From DarrenF - Mar., 16th 2010 - More »
Re: [WD12] Record locking in HF Classic mode...
Hello Darren I am all for the simple approach so we allow WIndev to manage the all locks automatically via the setting in the Files section of the project. The only section in which we explicitly loc ...
From Al - Mar., 16th 2010 - More »
Re: [WD12] Record locking in HF Classic mode...
Hi, I was wondering if there might be a project example somewhere? :confused:
From DarrenF - Mar., 15th 2010 - More »
Re: [WD12] Record locking in HF Classic mode...
Hi Darren This may not be of much use as I see you stated WD12 but in the Training Examples of WD14 there is an application 'WD Who's Locking' that manges this quite nicely. Regards DerekT
From DerekT - Mar., 15th 2010 - More »
Re: [WD12] Record locking in HF Classic mode...
Hello Darren, we read the record just again before we make the modification. So we get no error, if another user has modified the record since that time. This is not professional, but in a small netwo ...
From christoph - Mar., 15th 2010 - More »
Re: [WD12] Record locking in HF Classic mode...
Hi Stefan, Thanks for your reply... I didn't think it would be so difficult - I assumed it would just work - hence why I left it until now. Ah well, the laid plans etc...etc... Do you do anything at t ...
From DarrenF - Mar., 15th 2010 - More »
Re: [WD12] Record locking in HF Classic mode...
Hi Darren, we also have the kind of customer that will fall off his chair if/when he sees the standard WD locking message, but that doesn't surprise me. I think, you cannot expose a user to that kind ...
From Stefan Bentvelsen - Mar., 15th 2010 - More »