473,511 Members | 15,081 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ASP.Net SQLConnection leaving orphans

Hello, Everyone.

I have a strange one here. I'm a DBA with relatively low program
experience. Recently I was given an assignment to locate why our SQL Server
has "orphaned" connections. The setup we have is an IIS 6 machine that uses
a third party app designed with ASP .NET. The SQLConnection object is used
by the program to connect up to the SQL database. The connection string is
kept in a separate file so the programmers only have to refer to it by name
rather than retyping all the info. They use connection pooling via the
SQLConnection object, but the pooling doesn't seem to work all the time. We
have what seems to be an inordinate amount of connections that aren't
returning to the pool which we have to clean up every night.

I've researched on Google and the programmers say they have done everything
to check the code for bad connection issues. The only thing we can come up
with is that the ASP Worker Thread process doesn't throw some connection
threads back into the pool. We believe that the issue is caused when the
users click the 'X' button on their browser windows instead of hitting the
program's 'LOGOUT' button.

Can anyone shed any further light on this problem? Has anyone else had this
problem before? If so, can anyone point me in the direction of a solution?
The only thing I can think of is throwing a connection timeout value on the
connection, but I'm not sure if it should go on the SQL Server properties,
the ASP .Net SQLConnection properties or the IIS Server properties. I've
heard that if I do the timeout on SQL Server, I won't be able to put that
connection in the pool. Any help would be greatly appreciated.

Thanks!!!

Catadmin
Nov 19 '05 #1
3 1751
I noticed a strange absences in your message. You didn't mention whether or
not you had made sure that all Connections are closed when the app is
finished with them. This is one of those issues like "Is the plug plugged
in?" that is overlooked because it is so simple.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.

"Catadmin" <Ca******@discussions.microsoft.com> wrote in message
news:3E**********************************@microsof t.com...
Hello, Everyone.

I have a strange one here. I'm a DBA with relatively low program
experience. Recently I was given an assignment to locate why our SQL
Server
has "orphaned" connections. The setup we have is an IIS 6 machine that
uses
a third party app designed with ASP .NET. The SQLConnection object is
used
by the program to connect up to the SQL database. The connection string
is
kept in a separate file so the programmers only have to refer to it by
name
rather than retyping all the info. They use connection pooling via the
SQLConnection object, but the pooling doesn't seem to work all the time.
We
have what seems to be an inordinate amount of connections that aren't
returning to the pool which we have to clean up every night.

I've researched on Google and the programmers say they have done
everything
to check the code for bad connection issues. The only thing we can come
up
with is that the ASP Worker Thread process doesn't throw some connection
threads back into the pool. We believe that the issue is caused when the
users click the 'X' button on their browser windows instead of hitting the
program's 'LOGOUT' button.

Can anyone shed any further light on this problem? Has anyone else had
this
problem before? If so, can anyone point me in the direction of a
solution?
The only thing I can think of is throwing a connection timeout value on
the
connection, but I'm not sure if it should go on the SQL Server properties,
the ASP .Net SQLConnection properties or the IIS Server properties. I've
heard that if I do the timeout on SQL Server, I won't be able to put that
connection in the pool. Any help would be greatly appreciated.

Thanks!!!

Catadmin

Nov 19 '05 #2
Sorry.

The programmers say they've closed all the connections after they are done
pulling the data. They also say they've closed the datareader objects. They
say they haven't closed anything within the finalize or destructor method,
the connection string is the same because they are pulling it from the
web.config file, the connection reset value is set to true, they drop any
temporary objects and close all user defined connections.

Of course, this is what they tell me they've checked before and that they
have spent a lot of time going through the code to verify it all. Now it is
being given to me so that I can give them some fresh perspective. Nothing
I'm finding on the internet, though, is a lot different from any of this.

Catadmin

"Kevin Spencer" wrote:
I noticed a strange absences in your message. You didn't mention whether or
not you had made sure that all Connections are closed when the app is
finished with them. This is one of those issues like "Is the plug plugged
in?" that is overlooked because it is so simple.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.

"Catadmin" <Ca******@discussions.microsoft.com> wrote in message
news:3E**********************************@microsof t.com...
Hello, Everyone.

I have a strange one here. I'm a DBA with relatively low program
experience. Recently I was given an assignment to locate why our SQL
Server
has "orphaned" connections. The setup we have is an IIS 6 machine that
uses
a third party app designed with ASP .NET. The SQLConnection object is
used
by the program to connect up to the SQL database. The connection string
is
kept in a separate file so the programmers only have to refer to it by
name
rather than retyping all the info. They use connection pooling via the
SQLConnection object, but the pooling doesn't seem to work all the time.
We
have what seems to be an inordinate amount of connections that aren't
returning to the pool which we have to clean up every night.

I've researched on Google and the programmers say they have done
everything
to check the code for bad connection issues. The only thing we can come
up
with is that the ASP Worker Thread process doesn't throw some connection
threads back into the pool. We believe that the issue is caused when the
users click the 'X' button on their browser windows instead of hitting the
program's 'LOGOUT' button.

Can anyone shed any further light on this problem? Has anyone else had
this
problem before? If so, can anyone point me in the direction of a
solution?
The only thing I can think of is throwing a connection timeout value on
the
connection, but I'm not sure if it should go on the SQL Server properties,
the ASP .Net SQLConnection properties or the IIS Server properties. I've
heard that if I do the timeout on SQL Server, I won't be able to put that
connection in the pool. Any help would be greatly appreciated.

Thanks!!!

Catadmin


Nov 19 '05 #3
Catadmin,
Information you have provided is not enough to precisely comment on. All
programmers say that- we did it and it is your fault. You have to provide
the code segment that's pulling data from SQL database in order for us (the
programmer community) make any judgement.

ADO.Net does the connection pooling automatically and it reuses the
connections as long as the connection string remain the same between the
calls. Having said that - one must explicitly close the connection in the
same context it was open.

Thanks,
Prodip Saha
"Catadmin" <Ca******@discussions.microsoft.com> wrote in message
news:3E**********************************@microsof t.com...
Hello, Everyone.

I have a strange one here. I'm a DBA with relatively low program
experience. Recently I was given an assignment to locate why our SQL Server has "orphaned" connections. The setup we have is an IIS 6 machine that uses a third party app designed with ASP .NET. The SQLConnection object is used by the program to connect up to the SQL database. The connection string is kept in a separate file so the programmers only have to refer to it by name rather than retyping all the info. They use connection pooling via the
SQLConnection object, but the pooling doesn't seem to work all the time. We have what seems to be an inordinate amount of connections that aren't
returning to the pool which we have to clean up every night.

I've researched on Google and the programmers say they have done everything to check the code for bad connection issues. The only thing we can come up with is that the ASP Worker Thread process doesn't throw some connection
threads back into the pool. We believe that the issue is caused when the
users click the 'X' button on their browser windows instead of hitting the
program's 'LOGOUT' button.

Can anyone shed any further light on this problem? Has anyone else had this problem before? If so, can anyone point me in the direction of a solution? The only thing I can think of is throwing a connection timeout value on the connection, but I'm not sure if it should go on the SQL Server properties,
the ASP .Net SQLConnection properties or the IIS Server properties. I've
heard that if I do the timeout on SQL Server, I won't be able to put that
connection in the pool. Any help would be greatly appreciated.

Thanks!!!

Catadmin

Nov 19 '05 #4

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

Similar topics

1
558
by: Donnie Darko | last post by:
I'm trying to understand SqlConnection(), SqlCommand() For example. I use SqlConnection() as a parameter when I create a new SqlCommand. Then I open SqlConnection(), then I execute the...
4
5169
by: The Coolest Dolphin | last post by:
Hi all, I have a question/problem concerning usage of my sqlconnection throughout my program. In my main form (frmMain) I defined an sqlconnection (I've set the connection public so that I can...
13
4235
by: MuZZy | last post by:
Hi, Just wanted to make sure i get it right: consider this class: // =========== START CODE ============= class Test { private SqlConnection con = null; public void Connect() { con = new...
4
2045
by: Steve Richter | last post by:
I really miss c++ .... I have an SqlConnection object within my Web.UI.Page object. The thinking is that the connection to the database server is opened once when the page starts to do its...
9
4177
by: Roman | last post by:
Hello I have a component built in VB.2003. It has the following property: Public Shared mCONN As SqlConnection Public Property Connection() As SqlConnection Get Return mCONN End Get...
4
3878
by: Victor | last post by:
Hi Guys I have a problem here. I want to improve the performance for a website. When I looked into the system, I have found that the system made the "SqlConnection Object" static. That mean only...
3
2912
by: m | last post by:
Hello, I have been trying to use orphan and widow control to prevent page breaks immediately after h1 elements (on a CV). I have validated the css and html, and used the following hoping this...
0
7252
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
7371
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7432
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
7093
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...
1
5077
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
3230
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
3218
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1583
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
791
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.