Solved

Server Timeout - Modify Global.asa file

Posted on 2001-07-31
6
345 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
6 Comments
 
LVL 7

Accepted Solution

by:
John844 earned 300 total points
ID: 6338465
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
ID: 6338471
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
ID: 6338475
you can set the server.scriptTimeout very high.  I have used as much as 600 which would be 10 minutes.
0
Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

 
LVL 7

Expert Comment

by:John844
ID: 6338504
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
ID: 6338517
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
ID: 6338566
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
If condition on Html with Asp 11 48
Index on a Table 6 36
href return to normal window 5 43
Adding Clickable Links to JQuery Data Items 24 54
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

734 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