I agree with Patrice, it sounds like you are not closing or disposing the
connection. The behavior you are describing is consistent with connections
going out of scope in the open state and causing load on the GC until you
run out of Max Pool Size. The default max pool size of 100 is around 10x
what most heavy load applications should need and hitting this is almost
always a sign of a leak.
The most common problem is code like this:
open connection
execute //may or may not throw exception
close connection
In this code every time that execute throws an exception _for whatever
reason_ the connection will not close since the throw exits the current
scope. To fix this problem you can call close or dispose on a finalizer or
if you are coding in c# use the equivalent "using" construct.
try
open connection
execute //may or may not throw exception
finally
close connection
--------------------------
using connection {
execute
}// here we guarantee calling connection.Dispose()
Either of these approaches will guarantee that close or dispose is called on
the connection and plugs the leak.
If you are not running into this issue I would like to get more information
from you to set up a local repro, I am really interested in finding any
issues with pools of connections in distributed transactions.
Thank you,
--
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.
Johan Johansson said:
Sorry, my mistake; should be "Full", not "Closed"
Is there a distinction between Closing and Releasing a connection? I do close them all.
Should I implement the IDisposable interface? Would that really be
appropriate in the Data Access Layer when doing transactions
(ServicedComponent) further up in the Business Layer? What if I dispose the
database and later on need to rollback?
----- Patrice wrote: -----
What was the exact error message ? Is is that the pool is "closed"
or
"full"
? It looks like you are not releasing connection...
Patrice