Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / June 2004

Tip: Looking for answers? Try searching our database.

Disconnecting a SQL Connection from a WebService

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
John - 17 Jun 2004 20:25 GMT
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 - 18 Jun 2004 11:16 GMT
Do you close the connection when your .aspx is finished working with it?

> 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 - 18 Jun 2004 12:46 GMT
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?
>
> > 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 - 22 Jun 2004 14:44 GMT
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/default.asp?url=/library/en-us/cpguide/html/cp
conconnectionpoolingforsqlservernetdataprovider.asp


Hope this helps

Ian
> 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
[quoted text clipped - 5 lines]
> > > How do I get it to use only 1 SQL connection or at least drop old
> > connections?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.