Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SET REPROCESS TO 1 SECOND
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Divers
Thread ID:
00005084
Message ID:
00005086
Vues:
24
>I always have SET REPROCESS TO 1 SECOND on my main program. So, if two user try to do the INSERT INTO at the same time then the 2nd user will retry in 1 second and will be able to apply the command.
>
>Now, I am facing the situation that sometimes even on the retry there is a collision so then I have the File is in use by another error message. I thought that the SET REPROCESS TO 1 SECOND was an attemp to retry at one second interval until it succeed. But, it seems it only retry once.
>
>Someone mentioned to me that I can put the AUTO clase to retry indefinitely. But, is this killing the CPU. I only want to retry once every second and not many times in the same second.
>
>Any idea?

If you are inserting into a local table, and are worried about performance, why don't you setup a routine such as the following:

DO WHILE !RLOCK("0",SELECT())
WAIT WINDOW "Attempting Insert..." TIMEOUT 1 && or equivalent
ENDWHILE

INSERT INTO ...

UNLOCK RECORD 0

This code will attempt to lock the header (which I believe is necessary to insert records), insert and then unlock the file header.
Peter Stephens
Visual Records, Inc.

Lead Programmer for the general purpose record keeping system Visual Records. Written primarily in VFP 6.0 with a little C++.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform