Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Record pointer changes when other user inserts!
Message
 
À
21/06/2003 20:31:06
Gerry Schmitz
GHS Automation Inc.
Calgary, Alberta, Canada
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00802079
Message ID:
00802676
Vues:
35
Thanks Gerry. I did not know that RLOCK() in this context would lock the current record on disk not the one in the buffer.

I have modified my code to use table buffering and no locking after APPEND BLANK.

[If there is something in this complex form that moves the record pointer then that would trigger a TABLEUPDATE if record buffering is being used. This may have been the reason why occasionally unsaved records were being seen by other sessions.]

--George

>Your APPENDed record is "in the buffer"; by definition, it is already exclusive to you and "invisible" to everyone else until you TABLEUPDATE, or move off the record.
>
>In the current context, you are not locking your appended record (in the buffer), you're trying to lock the "current record" in the table ...
>
>>The code is very simple:
>>
SET MULTILOCK ON
>>USE CUSTOMER
>>=CURSORSETPROP("Buffering", 3)
>>APPEND BLANK
>>?RLOCK()
>>Now start another session of VFP and run the same code. The lock will fail.
>>
George
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform