General information
Forum:
Microsoft SQL Server
Environment versions
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.
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only