Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
INSERT-SQL
Message
De
15/08/1997 19:55:01
Larry Long
ProgRes (Programming Resources)
Georgie, États-Unis
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Divers
Thread ID:
00044588
Message ID:
00045071
Vues:
39
>>>So all records have to be copied from the source table to an array first then inserted into the target table. I forget which one only locks file header versus locking the entire file (shared file use), either inserting records or appending from.
>>The file has to be locked with both insert and append, because the record counter is in the header. Also, I believe that insert is supposed to be much faster.
>
>Curiosity got the best of me, and I had to look this up. In Jeb Long's VFP 3 Developer's Guide is a chart of how commands are affected by autolocking
>(pp 1269-1270). *Append From* locks the table , Append From Array, Append Blank and Insert (SQL) all lock the header only. Granted, both effectively lock the table and prevent new attemts by users to lock either the table or the header (but should not prevent new attempts at record locking). But, if another user on the system has an existing record locked for editing, you could still use the Insert SQL to add records to the table without affecting the other user(s) who have only record locks in place. You could not do this with *Append From*. So in a heavily used multi-user system, Insert SQL is the way to go (IMHO) to prevent some contention.
>
>Of course, much of this has been alleviated by table buffering. And, VFP does very well managing automatic file and record locking when used with buffering.
I must be confused. How can you lock the header only? What happens to the header if 3 or 4 people add records with an INSERT at the same time? The only way that the header can keep up with the correct count (I would think) would be to lock the file.
L.A.Long
ProgRes
lalong1@charter.net
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform