Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP.NET 2.0 - Sleeping connections staying open

Reply
Thread Tools

ASP.NET 2.0 - Sleeping connections staying open

 
 
=?Utf-8?B?QWRhbQ==?=
Guest
Posts: n/a
 
      08-15-2006
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
 
Reply With Quote
 
 
 
 
Juan T. Llibre
Guest
Posts: n/a
 
      08-15-2006
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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



 
Reply With Quote
 
 
 
 
Mark Rae
Guest
Posts: n/a
 
      08-15-2006
"Adam" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...

> 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.


 
Reply With Quote
 
=?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
Guest
Posts: n/a
 
      08-15-2006
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

 
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
Media Player not staying open after flash update rr@nospam.edu Windows 64bit 0 06-24-2010 11:20 AM
Lingering Idle Oracle Connections? Persistent connections? jobs ASP .Net 2 11-16-2007 03:37 AM
dos promt staying open when prog runs Patio87 C++ 4 08-18-2004 04:09 PM
Trouble staying connected to wifi Michael Giroux Wireless Networking 1 08-03-2004 08:33 PM
DBCP / Tomcat / MSSQL, connections staying active Michael Scovetta Java 0 06-04-2003 06:29 PM



Advertisments