Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
The Easy Way to Form a Primary Key
Message
De
07/03/2002 09:30:58
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
07/03/2002 09:22:39
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00629497
Message ID:
00629534
Vues:
10
>Hmm thanks
>
>I was a bit suspicious about that myself. The usual keytable methods lock the record in the keytable briefly to guarantee a unique key is returned.
>
>That would not be possible in a muti user environment because a user might be editing the latest record.
>
>Maybe this article should be amended to show this gotcha or perhaps removed.

Yes, the article seems to point us in the wrong direction.

Let me elaborate on what I said previously.

  • Table has 1000 records.
  • User1 adds a new record (buffering is enabled). He gets the record number 1001.
  • Before User1 saves (this may take minutes!), User2 adds a new record. PK = 1001, since the record created by User1 doesn't exist on disk, until TableUpdate() is issued.

    This can fail even for a single user, opening different forms (which is akin to multi-user access).

    Hilmar.
    Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
  • Précédent
    Répondre
    Fil
    Voir

    Click here to load this message in the networking platform