Set ConnObject = NOTHING?

Results 1 to 2 of 2

Thread: Set ConnObject = NOTHING?

  1. #1
    Join Date
    Dec 1969

    Default Set ConnObject = NOTHING?

    I have read in many articles that you MUST close your connection object as soon as possible and then set it to NOTHING. I have found that by closing the connection, you are releasing the connection to the connection Pool. However, Setting the connection to NOTHING seems to destroy the object and not release it to the pool at all. <BR><BR>I did a test by running a small site with approx. 10 connections. In the first test I closed the connection Object but I didn&#039t set it to NOTHING. After running SQL Trace I found that only one connection had been made.<BR><BR>In my next test, I ran the exact same site only this time I set the connection Object to NOTHING after closing it. My results in SQL Trace was that I had Created 10 seperate connections.<BR><BR>More interesting, the speed in my first test took about 25% of the time as the second test.<BR><BR>Someone please enlighten me.

  2. #2
    Join Date
    Dec 1969

    Default RE: Set ConnObject = NOTHING?

    Well by no means am I an expert here. But it is my understanding the reason for setting it to nothing, is to free resources on the Web server. I have an include file that I put at the beginning of all my asp data pages that creates all my objects and one I put at the end that sets them all to nothing. Through the page I may use those objects several times but they are closed at the end of the page. I have done a bunch of testing and this has been the fastest for me. In your test were you creating the connection and setting it to nothing multible times in one page or did your test span several pages?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts