Re: Connection Weirdness




"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/


.



Relevant Pages

  • Re: Washing machine schematic, OT.
    ... How could the connections become incorrect? ... position lug on the new timer box. ... timer replacement. ... roo cullers, ...
    (rec.audio.tubes)
  • Re: gdb help: debugging a segfault in boost::shared_ptr
    ... I am developing a database connectivity plugin for the Remedy Action ... I've developed a database pool for the plugin so the time ... The pool will also check if the connections are ... Thread-safe means that shared_ptr handle ...
    (comp.os.linux.development.apps)
  • Re: determining max pool size
    ... the larger the pool size, the more requests can be server. ... 500 open connections to SQL server I awfully lot.... ... close the connection without even executing the sql statement). ...
    (microsoft.public.dotnet.framework.aspnet)
  • JNDI Connection Pool issue
    ... I have found something strange with the jdk jndi connection pool. ... If you do not iterate over all the results returned by the query, ... private static HashMap connections; ... SearchResult searchResult= ...
    (comp.lang.java.programmer)
  • Re: MaxPoolSize - Recommendations
    ... Perhaps the pool is not leaking, ... using connections efficiently. ... for average 80 concurrent users. ... Microsoft doesn't have any recommendations concerning "max pool size" ...
    (microsoft.public.dotnet.framework.adonet)