Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Unique ID Key Issue
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00196308
Message ID:
00196315
Vues:
29
>I'd like to hear different methods to deal with ever existintg problem of avoiding to generate duplicate key numbers in a multi use environment.
>Specifically, we have a multi user application, we use a system table to keep the values of the last ID generated and use FLOCK() to prevent other user from getting to the table.
>This, for some reason doesn't work, we have found at one customer, duplication of ID's.
>The DataBase resides on an NT server and the APP resides on the workstations.
>Somebody suggested to me to use CoCreateGUID API call.
>I've been thinking about opening the system table exclusively while the new key is been generated.
>
>But I'd like to hear more ideas from you guys.
>
>Thanks
Hi Luis,

I assume that you're checking to make sure the FLOCK() didn't return .F. and that you either specified the workarea or made sure that the table you were trying to lock was in the current work area. If not, that's what I'd look at

BTW, I think that it's a more common practice to use RLOCK() to try to lock the record rather than the file. The practice is to issue a DO WHILE NOT RLOCK(), including a brief pause in the body of the loop.

hth,
George

Ubi caritas et amor, deus ibi est
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform