473,499 Members | 1,889 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

XMLHttpRequest and garbage collection

I got the following error:

Error: [Exception... "Component returned failure code: 0x80040111
(NS_ERROR_NOT_AVAILABLE) [nsIXMLHttpRequest.status]" nsresult:
"0x80040111 (NS_ERROR_NOT_AVAILABLE)"

.... with Firefox when using XMLHttpRequest. What's happenening? Is the
object being garbage collected before the network operation finishes?

My usage pattern is:

function modelChanged() {
var req = new XMLHttpRequest()
req.open('PUT', ... , true)
req.onreadystatechange = function() {
if(req.readyState == 4) {
// do stuff
}
}
req.send(documentToSend)
}
I am not holding a reference to the req object from the global scope.
Should I? I don't know how many HTTP operations I have going at a given
moment. What kind of stretchable data structure should I use for holding
the references to the request objects? Or should I attempt to cancel the
unfinished connection if another one needs to start before the preceding
one has finished?

--
Henri Sivonen
hs******@iki.fi
http://hsivonen.iki.fi/
Jul 23 '05 #1
1 5666


Henri Sivonen wrote:
I got the following error:

Error: [Exception... "Component returned failure code: 0x80040111
(NS_ERROR_NOT_AVAILABLE) [nsIXMLHttpRequest.status]" nsresult:
"0x80040111 (NS_ERROR_NOT_AVAILABLE)"

... with Firefox when using XMLHttpRequest. What's happenening? Is the
object being garbage collected before the network operation finishes?
Are you trying to read the status property at all? Your code below
doesn't show any access to status.
function modelChanged() {
var req = new XMLHttpRequest()
req.open('PUT', ... , true)
req.onreadystatechange = function() {
if(req.readyState == 4) {
// do stuff
}
}
req.send(documentToSend)
}
I am not holding a reference to the req object from the global scope.
Should I? I don't know how many HTTP operations I have going at a given
moment. What kind of stretchable data structure should I use for holding
the references to the request objects? Or should I attempt to cancel the
unfinished connection if another one needs to start before the preceding
one has finished?


There is a method called abort to do that
<http://www.xulplanet.com/references/objref/XMLHttpRequest.html>
so perhaps calling that improves things.

As for the error you get, are you able to use some HTTP sniffer to check
the HTTP request headers and the HTTP response headers that are occuring
when Firefox displays the error?
You could for instance install the extension
<http://livehttpheaders.mozdev.org/>
Then it might be easier to say/see why Firefox gives that error and
whether there is a bug in Mozilla or something else goes wrong.

But a search on Google groups
<http://groups-beta.google.com/group/netscape.public.mozilla.dom/browse_frm/thread/2b0670d4fc5a0110/54be6a36b56d276f?q=nsIXMLHttpRequest.status+NS_ERR OR_NOT_AVAILABLE&_done=%2Fgroups%3Fas_q%3DnsIXMLHt tpRequest.status+NS_ERROR_NOT_AVAILABLE%26safe%3Di mages%26lr%3D%26hl%3Den%26&_doneTitle=Back+to+Sear ch&&d#54be6a36b56d276f>
shows that others have run into the problem before and it seems there
are bugs open on bugzilla.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
14058
by: Matt Kruse | last post by:
I'm aware of the circular reference memory leak problem with IE/closures. I'm not sure exactly how to resolve it in this situation. Also, Firefox appears to grow its memory size with the same code....
34
6356
by: Ville Voipio | last post by:
I would need to make some high-reliability software running on Linux in an embedded system. Performance (or lack of it) is not an issue, reliability is. The piece of software is rather simple,...
5
3553
by: Bob lazarchik | last post by:
Hello: We are considering developing a time critical system in C#. Our tool used in Semiconductor production and we need to be able to take meaurements at precise 10.0 ms intervals( 1000...
20
2634
by: chris.schwalm | last post by:
This is part II of this <a...
8
3009
by: mike2036 | last post by:
For some reason it appears that garbage collection is releasing an object that I'm still using. The object is declared in a module and instantiated within a class that is in turn instantiated by...
56
3615
by: Johnny E. Jensen | last post by:
Hellow I'am not sure what to think about the Garbage Collector. I have a Class OutlookObject, It have two private variables. Private Microsoft.Office.Interop.Outlook.Application _Application =...
4
2966
by: daniel.internet | last post by:
Hello, I got one question, that may seems trivial to you, but I really dont understand it. Let's say we got this code: function ajax() { var obj; obj = new...
2
2427
by: Michael Nemtsev [MVP] | last post by:
Hello, In the current application we have several httpmodules to process pages, and we have several pages with calls directly through the XMLHttpRequest. Now the requiremens is to detect the...
158
7688
by: pushpakulkar | last post by:
Hi all, Is garbage collection possible in C++. It doesn't come as part of language support. Is there any specific reason for the same due to the way the language is designed. Or it is...
0
7134
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7012
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7180
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7225
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6901
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7392
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4920
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
1429
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
667
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.