Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Auto incr number or GUID?
Message
De
28/10/2003 03:56:47
Dorin Vasilescu
ALL Trans Romania
Arad, Roumanie
 
 
À
28/10/2003 02:52:07
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00842581
Message ID:
00843407
Vues:
29
I've tried hard this, didn't got even a single one within 10 milions iterations, made me believe that SYS(2015) wait a milisecond before return the value.

>I see. FYI sys(2015) duplication on fast computers are reported (I haven't yet see myself - mine counts as a very slow box these days).
>PS: MP boxes might duplicate it as well. However under normal circumstances unlikely.
>
>I wonder how you can have a unique stationID ? Wouldn't it at least require 6 bytes ?

When app starts, it checks for the workstation id in local configuration file. This WsId is a 3 chars string converted from an autoincrementing integer (in my case a Firebird SQL generator). If is not there, then just query the next integer id from server (needs an active connection), convert it and store in config file. It is very sure that keys generated will be unique. I used this way for a client-server app and we hadn't even a single error regarding duplicated PK's. Also a table on server is updated with data queried from user machine (computer name, user, workgroup, etc).



>Cetin
>
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform