Information générale
Forum:
Microsoft SQL Server
Versions des environnements
SQL Server:
SQL Server 2008
>>>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
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement