Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Most Software Stinks ...
Message
De
24/07/2002 17:01:24
 
 
À
24/07/2002 15:11:24
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00681831
Message ID:
00682301
Vues:
32
Thanks.

People have questioned the use of FLOCK(). However, the lock time is so short, I've never had problems even with 150-200 people hitting the table.

As part of my database maintenance routines, I check the last value in the table and make sure the value in the Keys table is correct. Since I have Exclusive use, I don't need to worry about people adding records. It also fixes things should the keys table get out of synch, but as far as I know, that's never happened.


>I went to your website. I really liked your article on Primary Keys. What annoys me about the article is how much work it has created for me. :-) Cutting out the garbage code I put in!
>
>I have seen other articles similar in nature, but obviously poorly described. Such as:
>
>Create the table "Keys" (Same as you)
>Assign the values there (Same as you)
>Assign the values to the data file (Same as you)
>
>The ommission is the FLOCK() to the Keys table to ensure exclusive access and where to put the code.
>
>
>I have already used that code for testing purposes. I modified it to figure out the MAX(ID) and increment by 2 for it's first use because my applications are already using Numeric IDs (my garbage code way.) This way the Keys table can be blown away, and the first time it is used it will start at the correct value.
>
>All of my tables already use a tcTable + "_ID" field so pulling the MAX(ID) is easy. It's pretty cool to see it work with a Ctrl+Y while browsing the table!
>
>Thanks again for a well written article and code.
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform