Disconnecting a SQL Connection from a WebService

Discussion in 'ASP .Net Web Services' started by John, Jun 17, 2004.

  1. John

    John Guest

    I have Web Service with a SQL Connection and every time the web service runs it creates a new SQL Connection on the SQL Server.
    How do I get it to use only 1 SQL connection or at least drop old connections?
    John, Jun 17, 2004
    #1
    1. Advertising

  2. Do you close the connection when your .aspx is finished working with it?

    "John" <> wrote in message
    news:...
    > I have Web Service with a SQL Connection and every time the web service

    runs it creates a new SQL Connection on the SQL Server.
    > How do I get it to use only 1 SQL connection or at least drop old

    connections?
    Antoni Massó Mola, Jun 18, 2004
    #2
    1. Advertising

  3. John

    John Guest

    Yes, I am closing and disposing of the SQL connection, after returning XML to the User. But I'm not disposing the rest of the webserver code, just the SQL Connection.
    As soon as I drop the connection to the SQL Server, SQL Server should be logining out the user acccount. Is that a correct statement?
    John

    "Antoni Massó Mola" wrote:

    > Do you close the connection when your .aspx is finished working with it?
    >
    > "John" <> wrote in message
    > news:...
    > > I have Web Service with a SQL Connection and every time the web service

    > runs it creates a new SQL Connection on the SQL Server.
    > > How do I get it to use only 1 SQL connection or at least drop old

    > connections?
    >
    >
    >
    John, Jun 18, 2004
    #3
  4. John

    Ian Jones Guest

    John,

    Not necessarily. .NET pools SQL connections and recycles them to improve
    performance as far as I understand.

    So when you close a connection, it may still stay connected to SQL Server
    from the 'pool', ready for the next instance of the sql connection object.

    http://msdn.microsoft.com/library/d...nectionpoolingforsqlservernetdataprovider.asp

    Hope this helps

    Ian
    "John" <> wrote in message
    news:...
    > Yes, I am closing and disposing of the SQL connection, after returning XML

    to the User. But I'm not disposing the rest of the webserver code, just the
    SQL Connection.
    > As soon as I drop the connection to the SQL Server, SQL Server should be

    logining out the user acccount. Is that a correct statement?
    > John
    >
    > "Antoni Massó Mola" wrote:
    >
    > > Do you close the connection when your .aspx is finished working with it?
    > >
    > > "John" <> wrote in message
    > > news:...
    > > > I have Web Service with a SQL Connection and every time the web

    service
    > > runs it creates a new SQL Connection on the SQL Server.
    > > > How do I get it to use only 1 SQL connection or at least drop old

    > > connections?
    > >
    > >
    > >
    Ian Jones, Jun 22, 2004
    #4
    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. sc0ri0n

    disconnecting rsh session

    sc0ri0n, Feb 16, 2005, in forum: Perl
    Replies:
    1
    Views:
    545
    Jim Gibson
    Feb 16, 2005
  2. Daniel Albisser
    Replies:
    2
    Views:
    1,384
    Daniel Albisser
    Feb 24, 2004
  3. Scott

    WebService To WebService HTTP Connection Limit

    Scott, Jan 31, 2006, in forum: ASP .Net Web Services
    Replies:
    1
    Views:
    637
    Scott
    Feb 1, 2006
  4. Roberto Giorgetti

    Error connection using webservice locally (3 webservice in balanci

    Roberto Giorgetti, Jun 13, 2006, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    195
    Roberto Giorgetti
    Jun 13, 2006
  5. afrinspray
    Replies:
    6
    Views:
    126
    afrinspray
    Aug 5, 2005
Loading...

Share This Page