[Mono-devel-list] Releasing connections from pool

Francisco Figueiredo Jr. fxjrlists at yahoo.com.br
Sun Dec 28 09:23:28 EST 2003


Hi all!

I'm working in getting connection pool in Npgsql.

But I'm facing a little problem I wasn't aware before:

When I close the connection, if it is being pooled, I return it back to 
pool. Ok, but what happens when the client program exits? I mean, if it 
specify Npgsql to use a pool, it opens a connection, close it and so 
exits, who will release the connection from the pool?

I know that the Stream object handle the unmanaged tcp connection and on 
its dispose(false) method it will release the unmanaged connection 
cleanly, but even with this, Postgresql still logs about receiving eof 
from the client connection.

I was checking the bytefx and sqlclient code about connection pool and I 
couldn't see anything about this too. So I suppose that with their code 
this also happens.

Pedro, guys, do you have any idea about that?

I was thinking about some way to register an eventhandler which would 
notice me about the app domain unloading where I could check the 
connection pool and release any connection there is in it.

Would this be possible? There may be some other clearer solution?

Thanks in advance.

Regards,

Francisco Figueiredo Jr.





More information about the Mono-devel-list mailing list