[Mono-list] Connection pooling?

Francisco Figueiredo Jr. fxjrlists@yahoo.com.br
Wed, 29 Dec 2004 13:56:22 -0200

Hash: SHA1

Aleksandar Dezelin wrote:
| Eric Scott wrote:
|> Yo;
|> I've got the mono 1.0.4 release with XSP and all that fun stuff.  I
|> keep getting a "object was used after it was disposed" error with my
|> Npgsql C#/ASP apps.  I found with google that I can get around the
|> problem by disabling connection pooling... how do I do that?
|> Thanx,
|>    Sigma

Hi Sigma.
| Look for the SqlConnection class in MSDN and pay attention to connection
| string property - there's a parametar which you can pass inside it to
| disable connection pooling. It's something like 'Polling=false'. You may
| also check Npgsql classes and search for the method that parses the
| connection string.

Yeap. It is the Pooling=false.
This problem has been fixed in Npgsql 0.7beta3. Note that if you are
getting that it has a high probability you may be leaking
Npgsqlconnections. If you can't get 0.7beta3, please check your code to
see if you don't get any Npgsqlconnection out of scope. When this
happens, Npgsql incorrectly returns a disposed networkstream to
connection pool and this is why you are getting this problem.

Sorry for any problem this may have caused.

| Another thing I will submit as a bug: when you have enough opened
| connection and connection pooling is on, when you reach the number of
| opened connections test application hangs. But it never thow an
| exception, just hangs until (I think) some of the connections closes.

Hmmmm, it should be throwning an exception of not being able to get a
I did a little test here and I could get the timeout exception.
The default timeout value is 15 seconds. Try to lower it to see if you
get the exception. timeout=3. Thanks for feedback Aleksandar.

I hope it helps.

- --

Francisco Figueiredo Jr.
Membro Fundador do Projeto MonoBrasil - MonoBrasil Project Founder Member

- -------------
"Science without religion is lame;
religion without science is blind."

~                  ~ Albert Einstein
Version: GnuPG v1.2.6 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org