I'm accessing a database in steps, and making sure that I dispose of all my DbConnection
objects & related when I've done with them; however, when all the network stuff is done & should all be closed I still find open network connections from the app on netstat
. How do I find out what class instance is keeping these connections open?
views:
20answers:
1
A:
Even though you are calling the Close method on your connection, the physical connection doesn't necessarily get closed due to connection pooling.
Otávio Décio
2010-03-24 14:11:25
Could you explain connection pooling in more detail?
thecoop
2010-03-24 15:12:25
Pooling is explained in detail here: http://msdn.microsoft.com/en-us/library/8xx3tyca.aspx. It optimizes data access by keeping physical connections open because closing and opening them are expensive processes.
Otávio Décio
2010-03-24 15:17:10