Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Benchmarks for VFP versus SQL Server
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Divers
Thread ID:
00485384
Message ID:
00486703
Vues:
15
>>The workstation writes a one record DBF (each field represents a single parameter) with .REQ extension into certain directory on the server and goes into the DO WHILE loop (with the timeout), waiting for the result DBF with the same name and .DBF extension to appear in the same directory.
>>
>>FoxPro server is actually a PRG with DO WHILE loop, constantly looking for the .REQ files to appear. When it finds one, it grabs it, stores the parameters from fields into memory variables and immediately deletes the file.
>>
>>Then it calls the calculation module. All the processing is done on the cursors in memory. When the calculation module creates a result cursor, it returns the control to the FoxPro server. FoxPro server copies the cursor to the DBF with
>>COPY TO (request_file_name + ".DBF")
>>and shows the execution time on screen.
>>
>>As soon as the result DBF appears in the directory, the client wakes up, grabs the result DBF into it's own cursor and deletes the DBF.
>>If it didn't get the result DBF in, say 10 sec, it just asks the user to try again later.
>
>Thanks Nick,
>
>So your client is also in a loop waiting for a (request_file_name+".dbf") to appear in that shared dir? Are you using a DO WHILE loop too?

Yes, that's correct, it's a DO WHILE loop. There is a sample code in Les Pinter's article, and mine is not much different.

>How well is this solution handling multiple concurrent requests/responses?

Since a processing time is a split second it's not a problem. Each user creates a request file with a unique generated name. If the FoxPro server is busy, the request file just stays in the directory until it is picked up. So there is a natural queue. On testing I had problems related to the server being too fast. For example, if there is no error handling routine, you may hit "File Access Denied" message while processing the request file. I take it that the request file just written into the directory is being picked up before the OS really releases it after writing. You can easily handle this in ON ERROR routine, and the simplest way I tried was just ON ERROR RETRY.

I also tried to run more than one instance of the FoxPro server PRG, and the problem was that it was so fast, that two instances might pick up and process the same request, or one instance picked the request file name too, but when it tried to open it, the file already had been deleted by the second instance.
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro

"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform