Re: Connection Weirdness
- From: "Miha Markic [MVP C#]" <miha at rthand com>
- Date: Mon, 15 May 2006 20:17:08 +0200
"David Wimbush" <david_wimbush@xxxxxxxxxxx> wrote in message
news:1147706848.154190.71360@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi Miha,
Thanks for taking an interest.
1. Yes. I've stepped through it and it definitely calls the
DataReader's Close.
2. Yes and no. My business object code does no threading but this app
is running under a service. Apparently, each time the timer fires my
code off it is in a separate thread from the previous timer event.
Yep, you are using System.Threading.Timer, right.
But
interestingly the connection pool seems to be at the Service app level
as some of these connections were logged in an hour ago and yet
executed their last batch very recently.
From docs:If MinPoolSize is either not specified in the connection string or is
specified as zero, the connections in the pool will be closed after a period
of inactivity. However, if the specified MinPoolSize is greater than zero,
the connection pool is not destroyed until the AppDomain is unloaded and the
process ends. Maintenance of inactive or empty pools involves minimal system
overhead.
Perhaps you are seeing connections due to that period of time. Are your
thread running concurently. That would explain why more connections are
being created. I assume you connections (since they are using integrated
security) are opened using same credentials.
Or that number derives from the fact that your Timer uses 10 threads from
ThreadPool or something in that direction.
Try setting MaxPoolSize to smaller size and see what happens (you'll get an
exception probably).
3. No. The connection string is as I quoted apart from I changed the
names for readability. (And security!)
No, no you have to show us the real one :-) (just kidding).
--
Miha Markic [MVP C#]
RightHand .NET consulting & development www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/
.
- References:
- Connection Weirdness
- From: David Wimbush
- Re: Connection Weirdness
- From: Miha Markic [MVP C#]
- Re: Connection Weirdness
- From: David Wimbush
- Connection Weirdness
- Prev by Date: Re: SqlDataAdapter Update table with AutoIncrement column
- Next by Date: Re: Provider Tracing
- Previous by thread: Re: Connection Weirdness
- Next by thread: Crystal Report HTML problem
- Index(es):
Relevant Pages
|
|