Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Communication link failure vs. ConnectionWrite
Message
 
 
To
17/04/2021 02:44:41
Walter Meester
HoogkarspelNetherlands
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
01679837
Message ID:
01679862
Views:
50
>>>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

Sorry for a follow up question (hopefully the last one)
You wrote:
>> if unsuccessfull my application will wait until forever until the connection comes back
I created a method of the application class that checks for the SQL connection and so on. This method is called from the conn_handle_access method (of course, if the time passed from the last connection is 5 or more seconds).
Do you mean that the code "stays" forever in the conn_handle_access until the oApp.check_sql_connect() (method that checks connection) returns .T.?

TIA
"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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform