Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Server Communication link failure
Message
 
 
À
24/07/2014 03:02:10
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01604517
Message ID:
01604575
Vues:
30
>>>>>>Hi,
>>>>>>
>>>>>>Would it be correct to assume that when SQL Select from VFP against SQL Server fails and the error is
>>>>>>
>>>>>>
>>>>>>Communication link failure
>>>>>>
>>>>>>
>>>>>>that the problem was that the SQL Connection timed out by the time user executed the SQL Select? Or if not, what else would be causing this type of error?
>>>>>>
>>>>>>TIA
>>>>>
>>>>>No, when the timeout is occurred then the error will be:
>>>>>"Timeout occurred", something like this.
>>>>>
>>>>>Communication link failure usually means that you do not have connection with SQL Server anymore.
>>>>>Some LAN troubles or if the SQL Server is on WAN maybe Internet connection is lost?
>>>>
>>>>A follow up question, please. Do you think if - on determining that this is the error message - I add a code to try to establish the connection to the SQL Server again?
>>>
>>>Usually before we issue any SQL command we try something that SHOULD return result.
>>>(That is very well stolen from Andy Kramek and Marcia Akins)
>>>
>>>IF SQLEXEC(handler goes here, "SELECT @@IDENTITY","crsTest") < 0
>>>   ** What? we have no connection
>>>   ** do what ever you wish. Quit the Application
>>>   ** try to re-establish connection
>>>ENDIF
>>>
>>
>>I have some places in my program where I do almost exactly the same; checking the connection. I was just concerned that if I do it as you, BEFORE ANY SQL command, I will slow down the application. But knowing that you are an expert in SQL Server and probably tested the effect of this approach on speed of the program. So I will follow your example.
>>Thank you!
>
>In the general case, your test code could succeed, but your payload code could still fail. So your payload still has to be fault tolerant - check error return codes or be wrapped in TRY...CATCH etc., and react appropriately. Why not just wrap your payload with the same fault tolerance you need to use for the test code?
>
>Long ago I used to use pre-tests for functions with some likelihood of failure but if one has well structured error handling and a general defensive-programming philosophy I no longer see the need.

Thank you.
"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