Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Connection handle is invalid
Message
De
30/11/2012 22:11:03
 
 
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Versions des environnements
SQL Server:
SQL Server 2008
Divers
Thread ID:
01558490
Message ID:
01558521
Vues:
45
>>>Hey is there a good way to determine if a connection is still valid???
>>
>>In the try /catch block try to execute a simple select statement, e.g. select @@Version or something.
>
>IMHO this will create a lot of wasted calls to the server. In my app there are hundreds of TableUpdate() issued. And doing the above before each one will create great deal of - IMHO - load to the server. I wish there was a method - at least during debugging - to figure out if the connection dropped. By the way, I check the connection handle value in the debugger and it has a value. But apparently, for TableUpdate() to work, it is not enough.

typical approach to such problems is to save time of last working time
and to check only if time elapsed is greater than certain threshold.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform