How to remotely close data connection

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi, there is a web app .net that a programmer who is no longer here wrote and
somehow a connection is currently left open so when the application tries to
open it an error is generated (connection is already open).
Just wondering if there is a remote way to close the connection as I have
access to the server?
Will the connection time out? I thought of stopping and restarting IIS but
there are a lot of users that will complain.
Thanks.
 
When an application closes a connection it is retuned into the pool in
anticipation of another application (another instance of the same
application in many cases) opening the connection. If the connection is
unopened for 4-8 minutes it will close on its own. The troubling part is
that the application is complaining about an open connection. If programmed
correctly, it should not do this. I suspect you need to get that person
back--there is something wrong.

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
 
Paul,

The only solution is to delve into the code and fix the problem. The
programmer who left, is not closing the connections appropriately - and that
is one mistake that is simply unpardonable. The only remedy is to close
them - so ADO.NET can pool the "still open" physical connection - for the
next 4-8 minutes, after which ADO.NET takes care of closing the actual true
physical connection for you. This way, not only do you get fantastic
connection pooling performance, you also never see the error that you
mention below.

A short term fix is to increase the pool size - but I would highly highly
highly highly highly highly highly highly highly highly highly highly highly
highly highly highly highly highly highly highly highly highly highly highly
highly recommend that as just borrowing time (and very little of it too) -
the real fix is to fix the actual problem - close the connections as the
programmer really should have.

- Sahil Malik [MVP]
http://codebetter.com/blogs/sahil.malik/
 
I concur 100%

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________

Sahil Malik said:
Paul,

The only solution is to delve into the code and fix the problem. The
programmer who left, is not closing the connections appropriately - and
that is one mistake that is simply unpardonable. The only remedy is to
close them - so ADO.NET can pool the "still open" physical connection -
for the next 4-8 minutes, after which ADO.NET takes care of closing the
actual true physical connection for you. This way, not only do you get
fantastic connection pooling performance, you also never see the error
that you mention below.

A short term fix is to increase the pool size - but I would highly highly
highly highly highly highly highly highly highly highly highly highly
highly highly highly highly highly highly highly highly highly highly
highly highly highly recommend that as just borrowing time (and very
little of it too) - the real fix is to fix the actual problem - close the
connections as the programmer really should have.

- Sahil Malik [MVP]
http://codebetter.com/blogs/sahil.malik/
 
Hi Bill, Sahil,
thanks for the information. Will have to put in some code to check if
the connection is open before attempting to open it or something to that
effect.
Paul.

William (Bill) Vaughn said:
I concur 100%

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
 
Yep this application has low usage and is being replaced in the next few
months so performance should not be an issue. For the application that will
replace it I plan on using one connection on each form, may have several
datasets on one form, will not be using a global connection in the global
aspx file, and will be using the data adapter fill command that (I think
opens and closes the connection for you.)
The connection that is on each form will use a connection string variable
set up in the web.config file to allow for changing dbases easily.
Hopefully this will take advantage of .NET connection pooling.
thanks.
 
Back
Top