Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to detect broken connection
Message
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01413992
Message ID:
01414035
Vues:
104
>A client reports sporadic messages indicating that the connection to the SQL database has been lost. This happens after they have had the application minimized for a period of time. Upon returning to the application, the user receives a connectivity error where the only options are Cancel, Ignore and Help -- none of which allow them to continue with the application. I suspect this may be related to the "KeepAlive" feature in SQL 2005. What is the best way to detect this situation and recover from it? Every method I've tried to test the connection just generates a SQL error--regardless of how Display Warnings has been set. The application has a shared connection used by remote views and SPT and is aware of the statement handle as well the connect string used to create it.
>
>It would seem that if SQL detects inactivity and idles (or breaks) the connection, it ought to be able to detect renewed activity and enable it--but that would be too easy :-)

Why is the connection staying open? Since connection handles are limited, standard practice is to connect, issue whatever SQL commands, and disconnect. A connection should remain open for the minimum time possible.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform