Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Avoiding locking conflicts with SQL -INSERT
Message
De
19/03/2001 16:47:28
 
 
À
19/03/2001 13:43:43
Brent Smith
Guardian Life Insurance Company
Spokane, Washington, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00486550
Message ID:
00486635
Vues:
11
>FWIW, my situation involves a FPW 26 app, but I think the question applies equally to VFP.
>
>My usual network append involves a file lock on a table of key values. I SET REPROCESS to a couple of seconds which allows plenty of time for one user's lock to clear before another gets in. Occasionally a user may wait a second or two before their record is appended but there are no errors generated.
>
>In some cases I use an INSERT (SQL) FROM MEMVAR. This code experiences occasional errors when two users attempt to insert at the same time. I only use this on logs where no surrogate PK is necessary and/or where the increased performance is an important factor.
>
>Is there a technique for avoiding network contentions for a record append using a SQL-INSERT? (Remember this is for FPW2.6 so no buffering or views).

Just like with your "usual" append, you should obtain an FLOCK() before you do your INSERT - SQL.
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform