Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Firebird connection pools never close connections idle for a long time

Reply
Thread Tools

Firebird connection pools never close connections idle for a long time

 
 
Gen
Guest
Posts: n/a
 
      08-18-2006
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


 
Reply With Quote
 
 
 
 
=?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
Guest
Posts: n/a
 
      08-18-2006
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
>
>
>

 
Reply With Quote
 
 
 
 
Gen
Guest
Posts: n/a
 
      08-22-2006
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


 
Reply With Quote
 
 
 
Reply

Thread Tools

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
How to close a TCP socket? (TCPSocket#close doesn't close it) Iñaki Baz Castillo Ruby 7 01-12-2010 01:32 PM
Having compilation error: no match for call to ‘(const __gnu_cxx::hash<long long int>) (const long long int&)’ veryhotsausage C++ 1 07-04-2008 05:41 PM
Java NIO selector close idle connections? meselfo Java 1 02-11-2008 10:08 PM
Lingering Idle Oracle Connections? Persistent connections? jobs ASP .Net 2 11-16-2007 03:37 AM
Re: Socket Connections - never seem to close Shripathi Kamath Java 3 08-14-2003 01:29 PM



Advertisments