Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
FLOCK() causes duplicate primary keys.
Message
From
26/08/2005 11:33:05
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows Server 2003
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01043971
Message ID:
01044337
Views:
13
>I take it that a DBC is not involved.
>So in that case I would use a semaphore when creating the primary key value. If the semaphore is not available, program would not create a primary key. It would either wait for the semaphore to be available or return to calling code telling user to try again.

I use free FoxPro 2 stucture tables only, no DBC.

Creating primary key requires reading last used key current value.
FLOCK() does this. It refreshed locked table with current values even from other users.

If you use semaphore (mutex?) then current values are not read to keys table.
So it is not possible to use some semaphore.
Andrus
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform