?
Solved

Server Timeout - Modify Global.asa file

Posted on 2001-07-31
6
Medium Priority
?
355 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 1200 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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

Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
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…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

764 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