[OpenLayers-Users] Error when using XMLHTTPRequest (throughrefreshing a wfs layer every n seconds)

Christopher Schmidt crschmidt at metacarta.com
Tue Apr 28 11:31:46 EDT 2009


On Tue, Apr 28, 2009 at 10:20:10AM +0200, Kris Geusebroek wrote:
> Hi all,
> 
>  
> 
> Found the solution to this and wanted to share that with you ;-)
> 
>  
> 
> Everytime a new read was done on the layer through refreshing the
> refresh event triggered the update of the BBOX strategy. Here the abort
> was called on the protocol.
> 
> In the protocol abort method the abort was propagated to the
> XMLHttpRequest.
> 
> The abort method of the XMLHttpRequest propagated again to the
> XMLHttpRequest native object or the ActiveX object depending on the
> browser used.
> 
> It seems that the abort is not working correctly if readystate has
> reached 4 already. So changing that to conditionally propagate the abort
> only when readystate > 0 and < 4 did the trick.
> 
>  
> 
> Attached you'll find a patch file including this change and also:
> 
> -          Setting readystatechange function after open is called (as
> good practice from ajaxian.com:
> http://ajaxian.com/archives/reusing-xmlhttprequest-without-abort)
> 
> -          Applied changes from version 1.0.3 of the used library from 
> http://code.google.com/p/xmlhttprequest
> 
>  
> 
> Hope its usefull for anyone (and makes it into a new release).

Kris,

Thanks for the work on this. Two things:
 * Since the XMLHttpRequest code is, as I understand it, primarily taken
   from the XMLHttpRequest project (that you linked); are the changes
   that you put in that file already included in1.0.3 of XMLHttpRequest?
   (Unfortunately, the license for that library changed, so now I have
   to go read the LGPL and figure out if we can just pull the latest
   version from them.)
 * Can you please sign a CLA -- either ICLA or CCLA -- according to 
   http://trac.openlayers.org/wiki/HowToContribute#ContributorsLicenseAgreements
   ? The ICLA can just be senet via email; we prefer to receive CCLAs
   via fax.


Thanks for your hard work on this! I'm of the opinion that we may want
to get this into 2.8; I'm not sure yet, but it will definitely be
included in some revision of the library.

-- Chris
>  
> 
> Cheers Kris
> 
>  
> 
> From: Kris Geusebroek 
> Sent: Monday, April 27, 2009 9:52 AM
> To: Kris Geusebroek; users at openlayers.org
> Subject: RE: [OpenLayers-Users] Error when using XMLHTTPRequest
> (throughrefreshing a wfs layer every n seconds)
> 
>  
> 
> Hi All,
> 
>  
> 
> Some further investigating shows that the location of the error
> (unspecified error) is at line 1087 /29937 (for uncompressed
> openLayers.js)
> 
> This is the line in XMLHTTPRequest.js where the this._object.send(vData)
> is called form cXMLHttpRequest.prototype.send
> 
>  
> 
> In script debugeer I can see that this._aborted = true
> 
> But nothing more strange things to see.
> 
>  
> 
> Anybode knows how I can investigate more?
> 
>  
> 
> Cheers Kris
> 
>  
> 
> From: users-bounces at openlayers.org [mailto:users-bounces at openlayers.org]
> On Behalf Of Kris Geusebroek
> Sent: Monday, April 27, 2009 8:17 AM
> To: users at openlayers.org
> Subject: [OpenLayers-Users] Error when using XMLHTTPRequest
> (throughrefreshing a wfs layer every n seconds)
> 
>  
> 
> Hi all,
> 
>  
> 
> When using openlayers to refresh my wfs layers frequently after some
> time using the application (zooming, panning etc while still refreshing
> every n seconds)
> 
> I get an error: unknown error at line 977 (or 1076 sometimes).
> 
> After that error the app becomes very unresponsive. Zooming in for
> example takes about 30 seconds after clicking the button in the PanZoom
> control.
> 
>  
> 
> My feeling is that the error comes form the XMLHttpRequest code so I
> need to investigate that more.
> 
> Anybody know a good help to investigate what goes wrong and to find out
> how to fix this?
> 
>  
> 
> Environment is IE6 (I know bad choice). But the error also comes in
> Firefox but there the response times remain ok.
> 
>  
> 
> Any help I much appreciated
> 
>  
> 
> Cheers
> 
>  
> 
> Kris Geusebroek
> 
> Consultant
> 
>  
> 
>  
> 
> Email: kgeusebroek at xebia.com <mailto:kgeusebroek at xebia.com> 
> 
> Tel: +31 (0)35 538 1921
> 
> Fax: +31 (0)35 538 1922
> 
> Mobile: +31 (0)6 30 697 223
> 
> http://www.xebia.com <http://www.xebia.fr/> 
> 
>  
> 
> Utrechtseweg 49
> 
> 1213 TL Hilversum
> 
> The Netherlands 
> 
>  
> 
> Xebia Blog !   http://blog.xebia.com/ <http://blog.xebia.com/>    
> 
> Xebia Podcast!   http://podcast.xebia.com/ <http://podcast.xebia.com/>  
> 
>  
> 




> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users


-- 
Christopher Schmidt
MetaCarta



More information about the Users mailing list