Database Connections

  • I want to know how to close already open database connections from ASP pages....very urgent...quick help will be appreciated....

    Amit vyas


    Amit vyas

  • You can use a kill command to get rid of them.

    This will terminate the connection as soon as it can.

    If the connection is in the middle of a query it will rollback any changes before terminating.


    Cursors never.
    DTS - only when needed and never to control.

  • Actually you have to be carefull with doing that against ASP sources as you can halt IIS if connection pooling is occurring and even sometimes when not. The object is to try to get all your connection to pool instead of opening new connections so basically when one query fires and ends it leaves its' connection open for a bit (which will ultimately timeout) and if another query fires with the same connection need it will use a free open connection (saves on total server expense of opening a connection and getting the data). What is happeing that you need to kill connections which I have found the safest way to do this is to stop IIS and restart IIS and webs. Doing a kill if causes a halt in IIS will require you to reboot your web server taking more time than most people really want a site to be down.

  • There is a lot to understand about connections especially when IIS is involved and you have connection pooling as Antares686 points out. Usually if you have IIS configured properly you don't really need to worry about this. Although you do need to make sure you are cleaning up your connections in your asp code. Make sure you close all your recordsets and set them to nothing. Same with the connections when you are done with them. Also remember that the default is for IIS to keep a session hanging around for 20 minutes before it actually releases the resources.

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply