PC Review
Forums
Newsgroups
Microsoft DotNet
Microsoft ADO .NET
Re: 37 Connection Pools - 1 Connection String
Forums
Newsgroups
Microsoft DotNet
Microsoft ADO .NET
Re: 37 Connection Pools - 1 Connection String
![]() |
Re: 37 Connection Pools - 1 Connection String |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
You can check the connections in the server programatically if your app has
the right permissions) with : "select count(*) from master.dbo.sysprocesses" A trick I like to use is to add a unique Workstation id to the connection string of the pool I want to track, so I do something like this: Guid workstationId = new Guid(); ConnectionString=ConnectionString+"Workstation Id='"+ workstationId +"'"; //note the single quotes arround the guid Then I can find only the connections in the pool like this: "select count(*) from master.dbo.sysprocesses WHERE hotname= '"+workstationId+"'" ; //note the single quotes arround the guid. Hope this helps, -- Angel Saenz-Badillos [MS] Managed Providers This posting is provided "AS IS", with no warranties, and confers no rights.Please do not send email directly to this alias. This alias is for newsgroup purposes only. I am now blogging about ADO.NET: http://weblogs.asp.net/angelsb/ "Sean Nolan" <seann@imgno%spaminc.com> wrote in message news:eKWzn#$KFHA.1136@TK2MSFTNGP10.phx.gbl... > I'm sure there are probably some components out there (but I don't know of > one off hand) - you're meaning tools that you can code into your app right? > The things I mentioned before (and the Performance Monitor, which I didn't) > are all good ways to do it at the system monitoring level. > > One thing to note is that there is no way for you to explicitly close > connections that are pooled. When you call Close on a connection, what you > are really doing is putting it back in the pool. If you do not call Close, > it will not be returned to the pool, so when a new connection is requested > from the pool a new one will have to be added (and hence you get another > real connection to SQL Server). If you do that enough times (100 by default) > you'll eventually reach the pool max and then you will start getting > exceptions. You can pick that up pretty quickly by monitoring the number of > connections to SQL Server. > > Sean > > "Elroyskimms" <elroyskimms@yahoo.com> wrote in message > news:1111179795.672031.254940@f14g2000cwb.googlegroups.com... > > Sean, > > > > I had one PID of 52, and that was it... > > Is there a tool that will show me open connections? As much as I try > > and close all connections before leaving their scope, I can't say that > > I'm perfect. It would be nice to get an accurate count of open > > connections so that I can debug individal code blocks properly. Any > > thoughts? > > > > -A > > > > |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

