Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > Disconnecting a SQL Connection from a WebService

Reply
Thread Tools

Disconnecting a SQL Connection from a WebService

 
 
John
Guest
Posts: n/a
 
      06-17-2004
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?
 
Reply With Quote
 
 
 
 
Antoni Massó Mola
Guest
Posts: n/a
 
      06-18-2004
Do you close the connection when your .aspx is finished working with it?

"John" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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?


 
Reply With Quote
 
 
 
 
John
Guest
Posts: n/a
 
      06-18-2004
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" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > 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?
>
>
>

 
Reply With Quote
 
Ian Jones
Guest
Posts: n/a
 
      06-22-2004
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/de...taprovider.asp

Hope this helps

Ian
"John" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
> > news:(E-Mail Removed)...
> > > 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?
> >
> >
> >



 
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
A internet connection issue LAN keps disconnecting Jer Computer Support 10 04-03-2007 01:25 AM
Wireless connection disconnecting =?Utf-8?B?QWxheW5l?= Wireless Networking 2 11-11-2006 10:47 AM
Wireless connection keeps disconnecting ??? Tripletmomplus2 Computer Information 3 10-18-2005 01:15 AM
Jetstream connection keeps disconnecting Edmond Lo NZ Computing 13 12-21-2004 02:08 AM
JAVAMAIL - IMAP Connection Failure: "* BYE disconnecting" Daniel Albisser Java 2 02-24-2004 02:10 PM



Advertisments