views:

387

answers:

2

We have a suspect application leaving a connection open. Just wondering on the debugging tools for this, as to whether anyone has any good tools for isolating this, commercial or otherwise.

I've Googled but only seem to bring up articles that describe the problem - not the steps for a solution.

This is the best article I've seen so far. - Others welcome.

Anyone have any products that isolate the problematic code? Profilers which perform this sort of thing, or any other advice to add?

+1  A: 

You can always check the Activity Monitor on SQL Server to see if the application is keeping the connection open.

It's under the Management node in SQL Server Management Studio. It will show you the host, application, user, number of open transactions, etc. for any applications that are connected to the database.

TLiebe
This will show the connections open. However it doesn't really link to any codebase to help isolate WHERE this occurs. We've had to fire the application in different areas to try and isolate a particular section of code, all whilst watching the profiler.
Paul
In fact it's in server's context menu and in the standard toolbar than under Management node. At least in SQL Management Studio 2008
abatishchev
A: 

Which language are you using? Under Java's BoneCP connection pool (http://jolbox.com) there is support to detect exactly this by watching for when a thread terminates and printing out a stack trace of the location where the connection was opened but not closed.

You can probably implement something very similar yourself though of course it will slow things down if you intend to use this in production.