Tracing SQL connections

  • Thread starter Thread starter William \(Bill\) Vaughn
  • Start date Start date
W

William \(Bill\) Vaughn

Consider that the tools take connections too. VS.NET takes a connection when
you have an open connection in the Data Links.
When you "close" a connection in your application, you aren't closing
it--you're returning it to the pool. The pool is destroyed when your
application ends and this closes any connections in the pool. Be sure to
change the "Application Name" argument in your connection string to see
which connections are being opened by ADO.

hth

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
MVP, hRD
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
 
Hi.

I am trying to use the SQL Server Profiler tool to follow the connections my
windows application opens and closes. On the Profiler I set the events
AuditLogin and AuditLogout to follow my connections. When I click a button
to open the connection, the Profiler shows me 2 connections, but the code
opens only one connection.

Another behaviour I don't understand is the logout. When I call the code
MyCon.Close the profiler doesn't show me a AuditLogout event, but when I
close the form it shows me 2 AuditLogout events. Can you help me to
understand what is happening?

TIA,
Erik Cruz
 
Hi Bill.

So, a pool is attached to an application? Didn`t know that. I was under the
impression that a pool is destroyed by some process that periodically
searches for and eliminates empty pools.

Thanks,
Erik Cruz
 
Nope. Each process owns the pools the code running in the process creates.
When the app dies, the pools go with it.
See my article on connection pools: www.betav.com/articles.htm


--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
MVP, hRD
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
 
Back
Top