Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Communication link failure vs. ConnectionWrite
Message
 
 
À
17/04/2021 02:44:41
Walter Meester
HoogkarspelPays-Bas
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Divers
Thread ID:
01679837
Message ID:
01679859
Vues:
53
>>>Make sure, that you only call SQLIDLEDISCONNECT() when the 5 second connection check fails. If you do this for each and every cursorfill rather than when neccesary, it is going to have performance effects as the connection is reset on the OBDC driver level.
>>>
>>>Walter,
>>
>>Please explain what do you mean by "5 second connection check fail".
>>Do you mean if there is no connection to the server for 5 or more seconds? If so, how do you check how long ago the application connected to the server? Does VFP have a native function for it or I need to create the application property and store the value myself?
>
>The intention is that whenever the last activity on the connection was more than 5 seconds ago, you check the connection with an empty command and fix the connection before you execute a new query.
>
>Technically I do this by storing the time when I access the applic.sqlhandle property (by using applic.sqlhandle_access). In my CA class I just do a =Applic.SQLhandle in the beforecursorrefresh and beforecursorfill events.
>
>In the sqlhandle_Access, I check the timedifference between now and the last time. If it was more than 5 seconds ago. I check the connection. Upon failure I try to reconnect. If successfull, it will continue to try to execute the original
>SQL statement (e.g. through cursorfill), if unsuccessfull my application will wait until forever until the connection comes back

Thank you very much for your help!
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform