By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,159 Members | 1,880 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,159 IT Pros & Developers. It's quick & easy.

Firebird connection pools never close connections idle for a long time

P: n/a
Gen
Hello there,

I am developing a web application using Firebird.NET provider ver 1.7
Connection pooling is being used to better the application's performance.

The problem is that the pool never closes its connections, even if they are
being idle for a long time.
Is there some way to make the pool automatically release a connection if not
being used for a certain period of time?
I don't want to use the "Connection Lifetime" property of the connection
string, because it is related to the connection's Close() method only.

Thank you in advance
Aug 18 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
I am not familiar with the Firebird ADO.NET provider, but if it follows the
ADO.NET model which you can be reasonably sure it does, then you should only
need to Close your connection when you are done with your work and it will be
returned to the connection pool. Be advised that connection pools are based
on the connection string, so it should be the same in order to cut down on
getting a new pool for each connection (not what you want).
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Gen" wrote:
Hello there,

I am developing a web application using Firebird.NET provider ver 1.7
Connection pooling is being used to better the application's performance.

The problem is that the pool never closes its connections, even if they are
being idle for a long time.
Is there some way to make the pool automatically release a connection if not
being used for a certain period of time?
I don't want to use the "Connection Lifetime" property of the connection
string, because it is related to the connection's Close() method only.

Thank you in advance
Aug 18 '06 #2

P: n/a
Gen
Thank you for your post Peter,

The problem is not a missing call to the Close() method of the connection -
infact the source code concerning database operations is capsulated in my
custom class named DB and exposing static methods like Extract(params),
Execute(params), Exists(params), etc. and each of them follows the following
pattern:

public static Method(params_1)
{
using (DB db=new DB(params_2)) {
// method source code
}
}

The Dispose() method of DB explicitly closes the connection to tha database

So the problem is that even when working correctly with the connection when
it returned to the pool it is never disposed of - it remaines active and the
database always has at least 1 user connected to it (while currently noone
is working with it)

The workaround I managed to find is the following implementation in the
global.asax.cs file:

protected void Session_End(Object sender, EventArgs e)
{
FirebirdSql.Data.Firebird.FbConnection.ClearAllPoo ls();
}

At least when a user's session expires all connection pools (if more than
one) will be triggered for clean up
Aug 22 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.