views:

98

answers:

4

We have a complex client-server application that is developed using .NET Framework and uses SQL Server 2005. We use LinqToSql but we manage the life time of all the connections and we pass open connections to any DataContext that gets created. We've also used Microsoft WF in this product. WF makes its own connections to persist workflow instances.

When the server runs for about a day or two, we endup with some "ReclaimedConnections" meaning that we haven't closed some of the SQL connections we've been using. We have reviewed all the code and used possible mean to make sure that we are closing any and all the connections we are creating. It seems almost impossible for a connection to remain open since there are very few places where we use them.

Is there any way to find out when a call has been made to SqlConnection.Open() or SqlConnection.Close(). We need to know when these methods are called and who was the caller(maybe get a call stack for that).

Thanks

A: 

try dotTrace: http://www.jetbrains.com/profiler/index.html

deerchao
+3  A: 

you can try red gate ANTS Performance Profiler

http://www.red-gate.com/products/ants%5Fperformance%5Fprofiler/index.htm

liya
I've been using the trial of this one for improving my asp.net-mvc site's performance and it is pretty solid (except that to this day it needed IE to be installed, but that's usually not that big of an issue)
borisCallens
A: 

You can use dotTrace or Performance Profiler included in Visual Studio.

terR0Q
Thanks for recommending dotTrace. First i tried Ants Profiler but it kept crashing so i couldn't do anything with it. dotTrace made our server application horribly slow but it gave me the result i needed. Thanks
O. Askari
A: 

YourKit .NET profiler http://www.yourkit.com/dotnet/ is not free, but you can get 20 days trial license for fully functional version.

--serge

Serge