Firebird connection pools never close connections idle for a long time

Discussion in 'ASP .Net' started by Gen, Aug 18, 2006.

  1. Gen

    Gen Guest

    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
     
    Gen, Aug 18, 2006
    #1
    1. Advertising

  2. RE: Firebird connection pools never close connections idle for a long

    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
    >
    >
    >
     
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=, Aug 18, 2006
    #2
    1. Advertising

  3. Gen

    Gen Guest

    Re: Firebird connection pools never close connections idle for a long

    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.ClearAllPools();
    }

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

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Shripathi Kamath

    Re: Socket Connections - never seem to close

    Shripathi Kamath, Aug 9, 2003, in forum: Java
    Replies:
    3
    Views:
    4,434
    Jayaram
    Aug 14, 2003
  2. Pat Dandenault

    onload=close() with Firebird

    Pat Dandenault, Jan 8, 2004, in forum: HTML
    Replies:
    10
    Views:
    5,035
    Pat Dandenault
    Jan 14, 2004
  3. jobs
    Replies:
    2
    Views:
    903
  4. meselfo
    Replies:
    1
    Views:
    1,204
  5. Iñaki Baz Castillo
    Replies:
    7
    Views:
    893
    Iñaki Baz Castillo
    Jan 12, 2010
Loading...

Share This Page