Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP.Net SQLConnection leaving orphans

Reply
Thread Tools

ASP.Net SQLConnection leaving orphans

 
 
=?Utf-8?B?Q2F0YWRtaW4=?=
Guest
Posts: n/a
 
      02-22-2005
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
 
Reply With Quote
 
 
 
 
Kevin Spencer
Guest
Posts: n/a
 
      02-22-2005
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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



 
Reply With Quote
 
 
 
 
=?Utf-8?B?Q2F0YWRtaW4=?=
Guest
Posts: n/a
 
      02-22-2005
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" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > 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

>
>
>

 
Reply With Quote
 
Prodip Saha
Guest
Posts: n/a
 
      02-22-2005
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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



 
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
500 tracker orphans; we need more reviewers Terry Reedy Python 0 06-19-2010 02:37 AM
Xandros 4: Relief for Windows 98/ME Orphans Au79 Computer Support 2 07-23-2006 08:16 PM
Can't open a SqlConnection Mark ASP .Net 3 07-19-2005 10:23 AM
Re: Reflection and SqlConnection WebDevHokie ASP .Net 0 07-10-2003 06:33 PM
Re: does an Sqlconnection object get shared at application level? Nick ASP .Net 0 06-27-2003 10:35 AM



Advertisments