[Mono-list] Connection pooling?

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


-----BEGIN PGP SIGNED MESSAGE-----
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
connection.
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.


- --
Regards,

Francisco Figueiredo Jr.
Membro Fundador do Projeto MonoBrasil - MonoBrasil Project Founder Member
http://monobrasil.softwarelivre.org



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

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

iQEVAwUBQdLTpv7iFmsNzeXfAQIZPQf/YvIx4fXvBMPgSTciR+LilRDLlZ4P5YkF
5tweVghZlwV3OSZfToaJfGaINmvlGjRPgAo6q56NS8/6gnjYVxZo50Eg3TbkMpnh
g3+roDFu9705/YlEmNwfR6N6GC0kHj32Oad4x7GsU3Kvr2HBjpFCbfWyKF8kMpHY
8UsgFN7UdHMfy6u8uo5450KM0h2zZ5trVN6pNm//USDjz6OupVNPjS9bvsVu+4Ja
UXSwSwvPjho3GeG5EWgpRWZ42HEtcDfAjaPo4BleZv6JVRapYJ7mTHr+FblrybxK
ip1/yKKLjjql0dZCbHcH+Fnv977aruMbxYpovqOsx3HOiGMDyhus/g==
=Ymt6
-----END PGP SIGNATURE-----