Solved

Server Timeout - Modify Global.asa file

Posted on 2001-07-31
6
324 Views
Last Modified: 2008-02-01
How can I modify the global.asa file to allow for the server not to time out so fast?

We have a page that allows the user to upload images however some times the images are quite large and thus sometimes they get a Server Timeout error.

I have been told to place a line of code in the Global.asa file, can anyone assist me here on what to place?

This is what we have that works for the upload:
-----------------------------------------------
function Session_OnStart() {
     var objConn = Server.CreateObject("ADODB.Connection");
        objConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=e:\\virtualhosts\\*********\\********.mdb;Mode=ReadWrite;Persist Security Info=False";
     objConn.ConnectionTimeout = 0;
     objConn.Mode = adModeReadWrite;
     objConn.CursorLocation = adUseClient;
     Session("objConn")=objConn;
        Session("userStatus")="unauthorized";
        Session("userID")=0;
        Session("strUploadPath") = "e:\\virtualhosts\\*********\\********";
        Application("ActiveVisitors")++;
}
------------------------------------------------
0
Comment
Question by:ASCAN
  • 4
  • 2
6 Comments
 
LVL 7

Accepted Solution

by:
John844 earned 300 total points
Comment Utility
I would only change the timeout for the pages working with the upload

you can change it on a page level by adding

dim intOldTimeOut
intOldTimeOut = server.scriptTimeout
server.scriptTimeout = 120 'to make it 120 seconds

at the bottom of the page add
server.scriptTimeout = intOldTimeOut
0
 
LVL 7

Expert Comment

by:John844
Comment Utility
the next thing I would change is I would remove the connection from the global.asa file.  Create you connections on the asp pages needing it and close it after you are finished with it on every page.
0
 
LVL 7

Expert Comment

by:John844
Comment Utility
you can set the server.scriptTimeout very high.  I have used as much as 600 which would be 10 minutes.
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 7

Expert Comment

by:John844
Comment Utility
FYI, the default value is 90 and I can find no limits in documentation on how high you can set it.
0
 

Author Comment

by:ASCAN
Comment Utility
Thanks, now to pick apart my global file and figure out what I need on that page. (My db guys are away on vacation and I am left figuring this stuff out.)

Thanks!
0
 

Author Comment

by:ASCAN
Comment Utility
John, We have two areas of the global.asa file. Can you recommend what I should do to have it work on the page level as you stated - only on that one file though.

I just can not afford to have this part of the site go down for any length of time. I would like to keep the global.asa file in place but remove if possible the upload part and place it on the page that has the upload, therefore hoping to keep the extended session only on that one script.

Is this possible? What would I include?

-----------------------------------------------------

<!--==Visual InterDev Generated - startspan==-->
<!--METADATA TYPE="TypeLib" NAME="Microsoft ActiveX Data Objects 2.5 Library" UUID="{00000205-0000-0010-8000-00AA006D2EA4}" VERSION="2.5"-->
<!--==Visual InterDev Generated - endspan==-->
<SCRIPT LANGUAGE=JScript RUNAT=Server>
function Application_OnStart() {
        Application("ActiveVisitors")=0;  
        Application("strSafeUrlApplication") = "*******.******.com";
        Application("strUrlApplication") = "***.***.***.***";
}

function Session_OnStart() {
     var objConn = Server.CreateObject("ADODB.Connection");
        objConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=e:\\virtualhosts\\*********\\********.mdb;Mode=ReadWrite;Persist Security Info=False";
     objConn.ConnectionTimeout = 0;
     objConn.Mode = adModeReadWrite;
     objConn.CursorLocation = adUseClient;
     Session("objConn")=objConn;
        Session("userStatus")="unauthorized";
        Session("userID")=0;
        Session("strUploadPath") = "e:\\virtualhosts\\******\\********\\";
        Application("ActiveVisitors")++;
}

function Session_OnEnd() {
        Application("ActiveVisitors")--;
}
</SCRIPT>
-------------------------------------------------------
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now