Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 SQL Profiler and Connection pooling

Author  Topic 

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2007-01-05 : 07:16:47
Hey everyone!

I have an issue that i believe is caused by improper use of connection pooling (It isn't used).

what i'd like to see in profiler is how many connections are
connected and disconnected.
I know there is an ExistingConnection event but i thought there were
alse Connect and Disconnect events.
But i can't find then anywhere in profiler under events.

What am i missing?



Go with the flow & have fun! Else fight the flow
blog thingie: http://weblogs.sqlteam.com/mladenp

snSQL
Master Smack Fu Yak Hacker

1837 Posts

Posted - 2007-01-05 : 15:03:24
It's the Audit Login and Audit Logout that you want (both appear under Security Audit).

Very simply, if you create a simple C# Windows app and put this code in a button click event
SqlConnection conn = new SqlConnection("data source=(local);initial catalog=Northwind;integrated security=SSPI");
conn.Open();


Every time you click the button, you'll get a new Audit Login event because connections can't be pooled if they are not closed.

But if you do this
SqlConnection conn = new SqlConnection("data source=(local);initial catalog=Northwind;integrated security=SSPI");
conn.Open();
conn.Close();


Every time you click the button you will not get Audit Login events after the first click because the first connection is in the pool and reused and returned to the pool each time. Obviously you'd normally have other code between the Open and the Close to actually use the connection.
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2007-01-05 : 17:08:55
yeah i found that out a few hours ago

thanx though.



Go with the flow & have fun! Else fight the flow
blog thingie: http://weblogs.sqlteam.com/mladenp
Go to Top of Page
   

- Advertisement -