OLE DB Connection Pooling / Set dbConn=nothing

Results 1 to 2 of 2

Thread: OLE DB Connection Pooling / Set dbConn=nothing

  1. #1
    Join Date
    Dec 1969

    Default OLE DB Connection Pooling / Set dbConn=nothing

    I&#039;ve been reading up on OLE DB Connections using IIS5, SQL2000, and ASP. My page connection method is Page (opening a new one on each page).<BR><BR>My Question: When using OLE DB Session pooling in ASP pages and when including the database connection on each page, is it still necessary to include the following?<BR><BR> dbConn.close<BR> Set dbConn = Nothing<BR><BR>Even if it is not necessary, will setting the database connection equal to nothing cause a problem? <BR><BR>For efficiency, I&#039;ve always plugged those in at the end of the page. I was taught to close everything that I open, and terminate it when done. With connection pooling, I am not sure if this still applies. As I thought on this, I began to wonder if setting a connection to NOTHING:<BR><BR>1) Terminates the Database Connection permanently so that it does not exist<BR>2) Terminates the Database Connection for that page use, and releases it to the general pool for 60 seconds so that someone else may use it if they come along.<BR><BR>Here is some background from on OLE DB Connections and the method that I am using:<BR><BR>MY resource says, "Microsoft realized that the speed hit of opening and closing a database connection on each page was a potential disadvantage of making the connection at the page level, and built a solution to lessen some of the impact of database connection pooling. For OLE DB, it is called both OLE DB Resource Pooling and OLE DB Session Pooling. For OLE DB, session pooling is on automatically. To turn it off, you must make registry changes. So what is session pooling? The concept is simple: Keep the connection open eve if no one is using it. OLE DB can keep connection alive for a certain period of time and give them to another user as requested. If one user requests a particular database connection, then, when the ASP is done processing, the connection falls back into a pool. If someone else comes along within 60 seconds, OLEDB Gives him the pooled connection instead of creating a new one. If none are in the pool or none are free, a new connection is created and opened. Session pooling eliminates much of the time disadvantage of page level connections."<BR><BR>Thanks in advance<BR>Andrew Russell<BR>andrewr@dice.com

  2. #2
    Join Date
    Dec 1969

    Default Articles

    on this are over at http://www.eggheadcafe.com<BR><BR>Once you terminate it, it releases it to the general pool. Setting your object to Nothing (or 0 or "") just releases it before the page is done processing...<BR><BR>For more in depth, check out that site... plenty of good articles and examples concerning your question.

Posting Permissions

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