Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Need help with a primary key
Message
From
10/06/2001 14:24:20
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
08/06/2001 15:46:23
David Fluker
NGIT - Centers For Disease Control
Decatur, Georgia, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00517080
Message ID:
00517563
Views:
20
>I just tested it with a program that uses a FOR NEXT loop to insert 20,000 records into a small table using SYS(2015) to generate a key. Two concurrent FoxPro sessions running this program simultaneously on a 866 Mhz PIII machine generated 33 duplicates. So I would say that this method is not good in a multiuser environment where keys are being generated very rapidly (Hundreds or more per second).
>
>Or trap the duplicate key error and try it again. That may be the best solution. I little slower, but more reliable.

I've used it for generating unique IDs for remote machines, i.e. for the synchronization and replication purposes, but only when accompanied with an user ID - I've used a two character prefix, plus the nine characters from sys(2015). Works like a charm, as long as no user runs it in parallel like you described.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Reply
Map
View

Click here to load this message in the networking platform