HTTPRequest Freezes For 5 Minutes Intermittently And Throws "Unknown name" Javascript Exception

O

oopaevah

I am using the Microsoft.XMLHTTP object to make server requests ie;
ajax. This is working 99% of the time but occasionally it will freeze
at the server for 5 minutes and then raise a javascript exception
"Unknown name".

After the exception I can run the same request ok, and keep doing so
until the next time it freezes for 5 minutes.

What does the "Unknown name" javascript exception mean?

Why does it freeze for 5 minutes?

I can't replicate this on my dev pc, it's only happening in a live
environment with IE6 and 2 load balanced IIS6 servers.
 
O

oopaevah

Are you using "synchronous" or "asynchronous" XMLHttp? Turn on the
Asynchronous option and your script won't hang. Otherwise, this is not
a JavaScript issue but an HTTP issue and the problem lies between your
server and your connection. I take it you have some sort of session
timeout and the connection keeps getting reset. Without seeing any of
your code to know what's going on here, I'd take a stab at it and say
"Unknown name" is probably an HTTP error that you're running into when
the request times out.

I'm using a synchronous http request, I've attached my function below.
I can't use asynchronous because the flow needs to be strictly
controlled due to the nature of the application. The catch() block is
triggered after the 5 minute freeze. The http request completes
successfully after 5 minutes.

This problem hasn't occured since iisreset was run last night. If this
problem comes back I will update this thread.

Thanks

CallServer : function( sAction, sSendMethod)
{
var sReturn = "";
var oEngine;// = this.Request.Engine;
var sParameterString = "";
var sPostString = null;

try
{
oEngine = new ActiveXObject("Microsoft.XMLHTTP");//ELMS TEST
if( oEngine != null)
{
if( oEngine.readyState == 4 || oEngine.readyState == 0)
{
var sUrl = "ServerInteract.aspx?token=" + Page.Token + "&dothis=" +
sAction;

if( arguments != null)
{
for( nParameterIndex = 2; nParameterIndex < arguments.length;
nParameterIndex ++)
{
sParameterString += arguments[nParameterIndex];
if( nParameterIndex < arguments.length - 1)
{
sParameterString += "&";
}
}
}

if( sSendMethod.toLowerCase() == "post")
{
sPostString = sParameterString;
}
else
{
sUrl += "&" + sParameterString;
}

sUrl += "&millis=" + new Date().getTime();

oEngine.open( sSendMethod, sUrl, false);
oEngine.setRequestHeader( 'Content-Type',
'application/x-www-form-urlencoded');

System.Log( "ServerInteract.CallServer() : Sending '" + sPostString
+ "' with action '" + sAction + "' to " + sUrl);

oEngine.send( sPostString);

sReturn = oEngine.ResponseText;

System.Log( "ServerInteract.CallServer() : Done : \r\n" + sReturn);

if( sReturn.indexOf( "exception:") == 0)
{
PageRendering.HandleError( sReturn);
sReturn = "";
}
}
else
{
System.Log( "ServerInteract.CallServer() : Cannot Send() because
oEngine.readyState = " = oEngine.readyState);
}
}
else
{
System.Log( "ServerInteract.CallServer() : Cannot Send() because
oEngine is null");
sReturn = "";
PageRendering.HandleError( "XmlHttpRequest Fail 1");
}
}
catch( e)
{
sReturn = "";
System.Log( "ServerInteract.CallServer() : Cannot Send() because of
exception '" + e.message + "");
PageRendering.HandleError( "XmlHttpRequest Fail 2: " + e.message);
}

return sReturn;
},
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,754
Messages
2,569,521
Members
44,995
Latest member
PinupduzSap

Latest Threads

Top