PC Review


Reply
Thread Tools Rate Thread

Connection Pools Question

 
 
William Reyes
Guest
Posts: n/a
 
      1st Aug 2003
I get the following error from my object periodically.

"System.InvalidOperationException. Timeout Expired. The timeout period
elapsed prior to obtaining a connection from the pool. This may have
occurred because all polled connections were in use and the max pool size
was reached."

My object only has one connection object from which all methods perform
database operations. Other objects within my app are coded the same way each
with just one connection object.

I thought when connections are made using the same connection string the
ado.net handled the conection polling automatically.

Is there any way to explicitly remove unused connections from the pool?
Is it possible I am leaving too many connections open?

Should I be closing and "killing the connection object prior to the
destructionr of my object, maybe in the finalizer??

I am just not sure.

Any help would be greatly appreciated.


 
Reply With Quote
 
 
 
 
Enzo Maini
Guest
Posts: n/a
 
      3rd Aug 2003
There is a way when making a connection to specify a value in the connection
string that will prevent the connection from being pooled for that
connection.

I do this with connections that are just used to authenticate the user.
Sometimes I am just checking if the user is allowed to do something. This
helps reduce connections in the pool on a busy system. You do get a
performance penalty but it is not as bad as this is made out to be and does
serve a purpose



"William Reyes" <(E-Mail Removed)> wrote in message
news:%23i8%(E-Mail Removed)...
> I get the following error from my object periodically.
>
> "System.InvalidOperationException. Timeout Expired. The timeout period
> elapsed prior to obtaining a connection from the pool. This may have
> occurred because all polled connections were in use and the max pool size
> was reached."
>
> My object only has one connection object from which all methods perform
> database operations. Other objects within my app are coded the same way

each
> with just one connection object.
>
> I thought when connections are made using the same connection string the
> ado.net handled the conection polling automatically.
>
> Is there any way to explicitly remove unused connections from the pool?
> Is it possible I am leaving too many connections open?
>
> Should I be closing and "killing the connection object prior to the
> destructionr of my object, maybe in the finalizer??
>
> I am just not sure.
>
> Any help would be greatly appreciated.
>
>



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Number of connection pools Bernd Microsoft ASP .NET 3 14th Apr 2009 09:37 PM
Connection timeout - Sleeping Processes - Connection Pools? Why oh Why mark.ellul@gmail.com Microsoft ADO .NET 4 17th Aug 2006 03:56 PM
connection pools yay or nay Troy Microsoft ADO .NET 3 21st Feb 2004 07:34 PM
Performance Monitor Connection Pools dave Microsoft ADO .NET 3 9th Jan 2004 04:24 AM
Connection Pools William Reyes Microsoft ADO .NET 1 17th Sep 2003 12:07 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:18 PM.