Connection Object problem

Results 1 to 2 of 2

Thread: Connection Object problem

  1. #1
    Join Date
    Dec 1969

    Default Connection Object problem

    When every session start, I create 1 connection object for each user to connect to the SQL Server.<BR><BR>And I close the each connection object when the session end or session timeout.<BR><BR>And I notice the session end or session timeout was not reliable, this cause me cannot close<BR>the connection object for each session/user and thus increase my IIS memory usage.<BR><BR>I would like to know what is the best way to close the connection object for each session/user?

  2. #2
    Join Date
    Dec 1969

    Default RE: Connection Object problem

    You should NEVER store an ADO Connection (or any other ADO object) in a session variable. This locks the users session to a single ASP thread and can cause serious threading/contention issues. It is FAR more efficient to create a connection immediately before using it and close and destroy it as soon as you are finished with it. Placing a live connection in a Session variable will DEFINETLY cause SERIOUS scalability problems. It may even limit the number of concurrent users to the number of ASP threads running - in a default configuration this is 20 per CPU.<BR><BR>Dunc

Posting Permissions

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