Problem with ASP.NET Session in SQL Server and Connection Pooling

Discussion in 'ASP .Net' started by RyoSaeba, Oct 5, 2006.

  1. RyoSaeba

    RyoSaeba Guest

    Hello,
    I have a problem with the session state set to Sql Server (AspNet 1.1,
    Windows Server 2003 on an Application Center cluster, Sql Server 2000
    on another server).
    Sometimes, when many user are using the application, we got this
    error:
    "System.Web.HttpException: Unable to connect to SQL Server session
    database. ---> System.InvalidOperationException: Timeout expired. The
    timeout period elapsed prior to obtaining a connection from the pool.
    This may have occurred because all pooled connections were in use and
    max pool size was reached."

    Is it safe/recommended to set a connetion pool in the Session
    connection string in Web.config?
    Actually I have put this definition in the Web.config:

    <sessionState
    mode="SQLServer"
    sqlConnectionString="data source=xxx.xxx.xxx;user
    id=xxx;password=xxx;connection reset = true;connection lifetime =
    15;enlist=true;min pool size=1;max pool size=200;"
    cookieless="false"
    timeout="2" />

    Thanks in advance!
    Ryo
    RyoSaeba, Oct 5, 2006
    #1
    1. Advertising

  2. the error means close is not being called on the connection. be sure you
    have no code that uses the same connection string. also check that you have
    no trouble connecting to dc for authenication.

    -- bruce (sqlwork.com)


    "RyoSaeba" <> wrote in message
    news:...
    > Hello,
    > I have a problem with the session state set to Sql Server (AspNet 1.1,
    > Windows Server 2003 on an Application Center cluster, Sql Server 2000
    > on another server).
    > Sometimes, when many user are using the application, we got this
    > error:
    > "System.Web.HttpException: Unable to connect to SQL Server session
    > database. ---> System.InvalidOperationException: Timeout expired. The
    > timeout period elapsed prior to obtaining a connection from the pool.
    > This may have occurred because all pooled connections were in use and
    > max pool size was reached."
    >
    > Is it safe/recommended to set a connetion pool in the Session
    > connection string in Web.config?
    > Actually I have put this definition in the Web.config:
    >
    > <sessionState
    > mode="SQLServer"
    > sqlConnectionString="data source=xxx.xxx.xxx;user
    > id=xxx;password=xxx;connection reset = true;connection lifetime =
    > 15;enlist=true;min pool size=1;max pool size=200;"
    > cookieless="false"
    > timeout="2" />
    >
    > Thanks in advance!
    > Ryo
    >
    bruce barker \(sqlwork.com\), Oct 5, 2006
    #2
    1. Advertising

  3. RyoSaeba

    RyoSaeba Guest

    bruce barker (sqlwork.com) wrote:
    > the error means close is not being called on the connection. be sure you
    > have no code that uses the same connection string. also check that you have
    > no trouble connecting to dc for authenication.
    >


    Thanks for the answer!
    For the other application connection to Sql Server I use a different
    connection string/pool and I have checked that every time the
    connection is correctly closed.
    I think that this problem is only of the Connection Pool used for the
    Asp.net Session management.
    But is it correct to define a connection pool in the string
    "sqlConnectionString" of the "sessionState" section of Web.config? Or
    for the sessionState is better don't define a connection pool in the
    connection string?
    Thanks.
    Ryo



    >
    > "RyoSaeba" <> wrote in message
    > news:...
    > > Hello,
    > > I have a problem with the session state set to Sql Server (AspNet 1.1,
    > > Windows Server 2003 on an Application Center cluster, Sql Server 2000
    > > on another server).
    > > Sometimes, when many user are using the application, we got this
    > > error:
    > > "System.Web.HttpException: Unable to connect to SQL Server session
    > > database. ---> System.InvalidOperationException: Timeout expired. The
    > > timeout period elapsed prior to obtaining a connection from the pool.
    > > This may have occurred because all pooled connections were in use and
    > > max pool size was reached."
    > >
    > > Is it safe/recommended to set a connetion pool in the Session
    > > connection string in Web.config?
    > > Actually I have put this definition in the Web.config:
    > >
    > > <sessionState
    > > mode="SQLServer"
    > > sqlConnectionString="data source=xxx.xxx.xxx;user
    > > id=xxx;password=xxx;connection reset = true;connection lifetime =
    > > 15;enlist=true;min pool size=1;max pool size=200;"
    > > cookieless="false"
    > > timeout="2" />
    > >
    > > Thanks in advance!
    > > Ryo
    > >
    RyoSaeba, Oct 6, 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. William \(Bill\) Vaughn

    Re: SqlConnection and connection pooling

    William \(Bill\) Vaughn, Nov 14, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    488
    William \(Bill\) Vaughn
    Nov 14, 2003
  2. Edward W.
    Replies:
    5
    Views:
    3,276
    =?Utf-8?B?SEFSSSBQUkFTRCBCQVJV?=
    Dec 15, 2004
  3. Rob Nicholson

    ADO.NET, connection pooling and ASP.NET

    Rob Nicholson, Aug 31, 2005, in forum: ASP .Net
    Replies:
    18
    Views:
    4,483
    Rob Nicholson
    Sep 17, 2005
  4. =?Utf-8?B?c2NvdHRybQ==?=

    sql session state for .net v1.1/.net v2.0 and sql server 2005

    =?Utf-8?B?c2NvdHRybQ==?=, Feb 13, 2006, in forum: ASP .Net
    Replies:
    3
    Views:
    2,789
    Steven Cheng[MSFT]
    Feb 16, 2006
  5. =?Utf-8?B?Sm9lU2Vw?=
    Replies:
    2
    Views:
    1,471
    =?Utf-8?B?Sm9lU2Vw?=
    Oct 9, 2006
Loading...

Share This Page