Solved

Server Timeout - Modify Global.asa file

Posted on 2001-07-31
6
327 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
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Translate a cURL request to Classic ASP 4 418
pass url parameter as session 9 48
Age between date range query (SP) 13 52
Server Timeout with Loop 6 38
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…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

863 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

19 Experts available now in Live!

Get 1:1 Help Now