|
-
Oct 11th, 2001, 09:11 PM
#1
Thread Starter
Hyperactive Member
Object declarations in ASP global.asa
Hi fellow developers,
Put your thinking caps on...
I have read advice from many experts in the industry advising developers not to use ADODB.CONNECTION Objects in the global.asa file as they keep connections open for a long time and doesnt use connection pooling
ie. declared in the global.asa file
<OBJECT RUNAT=SERVER PROGID=ADODB.CONNECTION ID=MYCONN SCOPE=SESSION or APPLICATION>
REM OBJECT SCRIPT
</OBJECT>
Say I have 30 pages that uses the ADODB.CONNECTION object and instead of writing Server.CREATEOBJECT("ADODB.CONNECTION") for each and every 30 pages. I resort to using the above-mentioned object in the global.asa file.
BUT this is not advised according to books and experts, what is the next best alternative ? the INCLUDE DIRECTIVE doesnt help much as I still have to update 30 pages to include the file and if the INC File is moved, I still have to update 30 pages.
Tell me, if I close my connection explicitly by setting MYCONN.CLOSE after every page is executed, will it resolve the problems keeping connections open for a long time and also the problems of connection pooling ???
If i create a page-level adodb.connection using server.createobject then open and close it explicitly, I can set the page-level connection object to nothing at the end, of course I cant set a <OBJECT> that runs in Session or application scope to nothing, does that have any effect though even if I close all open connections at the end of every page ?
What I am trying to ask is that, even if the above-mentioned method of setting a Connection object at the session or application level is frowned upon as they keep connections open for a long time and doesnt use connection pooling
ie. declared in the global.asa file
<OBJECT RUNAT=SERVER PROGID=ADODB.CONNECTION ID=MYCONN SCOPE=SESSION or APPLICATION>
REM OBJECT SCRIPT
</OBJECT>
Will closing them explicitly at the end of every page (even though I CANNOT set them to nothing) rectify those problems ? If not, what do I do if I always have to Server.createObject for like 30-50 webpages ?
Thanks for any advice and tips
William T
Software Architect / Chief Software Developer
Softwaremaker.Net Pte Ltd
http://www.Softwaremaker.net
*** Things are always the darkest before they go pitch black ***
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|