469,946 Members | 1,750 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,946 developers. It's quick & easy.

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

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.

Dec 4 '06 #1
2 4597

oo******@yahoo.co.uk wrote:
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.
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.

Dec 4 '06 #2
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;
},

Dec 5 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by jon morgan | last post: by
reply views Thread by hantheman | last post: by
9 posts views Thread by Klaus Johannes Rusch | last post: by
9 posts views Thread by Adem | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.