Find ... No-lock no-wait

enoon

Member
Hi,

Recently I've encountered a project where has in many places statements like FIND ... NO-LOCK NO-WAIT.
NO-LOCK and NO-WAIT wouldn't be mutually exclusive, like, if you don't want to lock the records, you just want to read them, it is useless the NO-WAIT keyword (FIND...NO-LOCK and NO-ERROR would also be grea here). Otherwise, it has more sense I mean, you use the NO-WAIT with an EXLUSIVE-LOCK option.

From what you know, has this type of construction any use or can be considered a bad habit?
 
From what I remember from Progress training courses, is if the no-wait option is used with a no-lock, the no-wait is ignored by the compiler. So yes it's is poor programming. The no-wait should not be used Willy-nilly.

If Progress Professional Services got hold of the code they would pickup on it and demand the code to be corrected. I should know as I worked with PSUK a few years back.

Also it's similar to using a locking statement on temp-table using no-lock,exclusive-lock and shard-lock was a NO NO (Slap on the back of the hand).
 
It's a bad habit.

But a fairly harmless one as these things go. Unlike automatically adding FIRST to every FIND (which can lead to real bugs), tossing on a spurious NO-WAIT does little harm. Mostly you're just wasting typing time and disk space and showing a sloppy attitude.
 
hi TomBascom,

NO-lock with no-wait iam hearing newly as we practiced with NO-lock NO-error :cool:. i never try using this, but after ur qustion i had try with it. There is nothing wrong with it, but as it specifed as wrong practice in basic of developers guide. i felt different with ur qustion trying with no-wait. good try with different options. :)
 
Back
Top