Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Server Timeout - Modify Global.asa file

Posted on 2001-07-31
6
Medium Priority
?
361 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

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…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

610 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