Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Rlock
Message
De
17/09/1997 13:36:49
 
 
À
17/09/1997 13:07:58
Shane Gilbert
Oklahoma State Department of Education
Norman, Oklahoma, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Re: Rlock
Divers
Thread ID:
00050424
Message ID:
00050431
Vues:
24
>I am trying to maintain some existing code written in FP 2.6. The program uses rlock() and unlock. I think I see a potential bug but I am not familiar enough with using rlock() to know for sure. Here is what is happening:
>
>SELECT A
>USE claims
>SELECT B
>USE cumtotals
>....Get various input
>SELECT A
>IF rlock()
> REPLACE *fields*WITH *variables*
>ELSE
> wait window "Lock failed try again"
> UNLOCK
> LOOP
>ENDIF
>SELECT B
>REPLACE "fields* WITH *variables*
>UNLOCK
>
>It seems to me that there should be an UNLOCK right before SELECT B, and then another rlock() before REPLACE fields in B. Also, does the LOOP command retry the rlock or where does it go?

Basically, you are right, any RLOCK() should be followed by UNLOCK. However, in regard to this particular code, one can say that RLOCK() is not necessary at all, and REPLACE command implicit lock will be handled by SET REPROCESS TO AUTOMATIC. It might be the case, however, that record in A has been locked in data-entry form (in other part of app) by another user. Then using of RLOCK() is understandable, and otherwise if B record cannot be locked by data-entry form, then RLOCK() for B is unnecessary.
Edward Pikman
Independent Consultant
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform