473,462 Members | 1,350 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

ASP.NET 2.0 - Sleeping connections staying open

I'm wondering how widespread this problem is.

I had an application written in ASP.NET 1.1.
It worked fine.

Then I converted it to ASP.NET 2.0.
Now, I'm getting the error that I've seen others mention.
Specifically, sleeping connections (SQL Server) aren't getting closed and
after a period of time (about a day for my app) the app crashes because the
maximum number of connections has been reached.

All connections were explicitly closed in the code, but I sttil got the error.
Finally, I modified my vode to dispose every single connection after use.
This fixed my problem.

However, this seems to be an extreme fix which creates unnecessary overhead
on the SQL Server.

Who else is seeing this?
Is this a bug in ASP.NET 2.0?

-Adam
Aug 15 '06 #1
3 1993
Here's your solution :
Finally, I modified my code to dispose every single connection after use.
That is a "best practices" recommened procedure.

re:
Is this a bug in ASP.NET 2.0?
Given that you fixed it in code, no, it's not an ASP.NET issue.

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"Adam" <Ad**@discussions.microsoft.comwrote in message
news:CA**********************************@microsof t.com...
I'm wondering how widespread this problem is.

I had an application written in ASP.NET 1.1.
It worked fine.

Then I converted it to ASP.NET 2.0.
Now, I'm getting the error that I've seen others mention.
Specifically, sleeping connections (SQL Server) aren't getting closed and
after a period of time (about a day for my app) the app crashes because the
maximum number of connections has been reached.

All connections were explicitly closed in the code, but I sttil got the error.
Finally, I modified my vode to dispose every single connection after use.
This fixed my problem.

However, this seems to be an extreme fix which creates unnecessary overhead
on the SQL Server.

Who else is seeing this?
Is this a bug in ASP.NET 2.0?

-Adam

Aug 15 '06 #2
"Adam" <Ad**@discussions.microsoft.comwrote in message
news:CA**********************************@microsof t.com...
Finally, I modified my vode to dispose every single connection after use.
This fixed my problem.
Quite so - that's what you should have been doing from the start...
However, this seems to be an extreme fix which creates unnecessary
overhead
on the SQL Server.
Disposing connections creates no overhead on the SQL Server - quite the
reverse...
Is this a bug in ASP.NET 2.0?
No.
Aug 15 '06 #3
You may be confusing the connections you see in Enterprise Manager with your
ADO.NET SqlConnection object you use in your code.

Your SqlConnection should ALWAYS be closed immediately after use. This
allows the connection to return to the pool. Provided the connection strings
you use are all the same, that is the most efficient "best practices" coding
pattern.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Adam" wrote:
I'm wondering how widespread this problem is.

I had an application written in ASP.NET 1.1.
It worked fine.

Then I converted it to ASP.NET 2.0.
Now, I'm getting the error that I've seen others mention.
Specifically, sleeping connections (SQL Server) aren't getting closed and
after a period of time (about a day for my app) the app crashes because the
maximum number of connections has been reached.

All connections were explicitly closed in the code, but I sttil got the error.
Finally, I modified my vode to dispose every single connection after use.
This fixed my problem.

However, this seems to be an extreme fix which creates unnecessary overhead
on the SQL Server.

Who else is seeing this?
Is this a bug in ASP.NET 2.0?

-Adam
Aug 15 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: D. Niemeyer | last post by:
Hello All, Currently we are running MySQL 4.0.17-nt on a Server 2003 machine. I am having a problem with connections hanging around in a sleep state, and building up over time. Eventually...
0
by: D. Niemeyer | last post by:
Hello All, Currently we are running MySQL 4.0.17-nt on a Server 2003 machine. I am having a problem with connections hanging around in a sleep state, and building up over time. Eventually...
6
by: ujjc001 | last post by:
Hello all. I have many connections that are sleeping. I can right click, kill, up to 2 at a time. It takes about 20 seconds to kill it. Is that normal? I tried to make a stored procedure to...
1
by: Chad | last post by:
I am using SQL Server 2000. In Enterprise Mgr, under Management/Current Activity, I see a list SPIDs. I have a multi-tiered .NET web app that uses ADO.NET to connect to the database. Each time a...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.