Connection object

Results 1 to 4 of 4

Thread: Connection object

  1. #1
    John Harvey Guest

    Default Connection object

    Hello,<BR> I was wondering if anyone could tell me if there are any disadvantages to putting an ADO connection object into an Application variable. Will it increase performance, or slow it down?<BR>Thanks in advance,<BR>John Harvey<BR>

  2. #2
    Join Date
    Dec 1969
    Posts
    2,849

    Default RE: Connection object

    Don&#039t do this. This way, you only have one connection object for the entire web site. Say that you have 20 concurrent users, and each need to hit the database. If you only have one connection object, while another is using it, the other 19 have to wait until it is available.<BR><BR>Also, do not put connection objects in session variables. Create an instance of a connection object each time one is needed, and close/destroy it as soon as you are done with it.

  3. #3
    John Harvey Guest

    Default RE: Connection object

    Thanks Scott,<BR> This is what I am doing right now, I open a connection for each ASP Page (that needs one) and close it as soon as I&#039m done with it. I am looking for ways of optimizing performance. (Any ideas?)<BR>Regards,<BR>John Harvey<BR>

  4. #4
    Join Date
    Dec 1969
    Posts
    2,849

    Default RE: Connection object

    Here are a few resources on maximizing ASP performance (not all deal explicitly with database performance, although most cover it at least somewhat:<BR><BR>Maximizing Performance<BR>http://msdn.microsoft.com/workshop/server/asp/maxperf.asp<BR><BR>Optimizing Performance<BR>http://www.4guysfromrolla.com/webtech/110898-1.shtml<BR><BR>Using Connection Pooling to Optimize Performance<BR>http://www.15seconds.com/Issue/970531.htm<BR><BR>Good luck, and happy programming! :)


Posting Permissions

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