javascript - Call stack size exceeded after several clicks in a combobox -
i'm have combobox on website built dojo , using arcgis javascript api. since combobox can contain thousands of entries, i'm proceeding paging, dispatching 25 entries @ time.
if client clicks quickly, in compulsive way, on "more results" displayed @ end of 25 entries list, ends (after few dozens of clicks) error.
- chrome displays "rangeerror : maximum call stack size exceeded".
- firefox gives "internal error : recursion".
- we have not been able generate issue on ie.
closing browser or emptying cache not help. iis wcf service application pool needs recycled if user wants call new request.
the combobox datastore created within widget :
var cbovaluedatastore = new com.<...>.data.idsvaluesqueryreadstore( { url: "proxy.ashx", requestmethod: "get", doclientpaging: false, url2: getvaluesurl } );
the idsvaluesqueryreadstore class starts with
require( ["dojo/_base/declare", "dojox/data/queryreadstore", "dojo/_base/lang", "dojo/json", "dojo/_base/array"], function(declare, queryreadstore, lang, json, array) { declare( "com.fujitsu.data.idsvaluesqueryreadstore", queryreadstore, {
the idsvaluesqueryreadstore class contains these 2 functions called everytime user clicks on "more results" :
fetch: function(request) { console.log("idsvaluesqueryreadstore : fetch"); var pagenumber = math.floor(request.start / request.count) + 1; request.serverquery = { url: this.url2 + request.query.where + "&start=" + pagenumber + "&count=" + request.count }; return this.inherited("fetch", arguments); },
and
_filterresponse: function(data) { console.log("idsvaluesqueryreadstore : _filterresponse"); data = json.parse(data); data.items = this._datatoitems(data[0]); data.numrows = data[1]; return data; },
i have looked through code recursion errors, such function calling itself, can't find anything.
i have monitored ressources while launching bug, , there no extraordinary charges on cpu, network, disk or memory.
i don't know solve issue. have read case http://www.codeproject.com/tips/765248/resolve-too-much-recursion-error-when-using-jquery event propagate recursively between previous , next buttons, , wondered if couls case picklist paging... if so, have no idea how solve this!
any clue, anyone?
edit #1 (2015-10-01) :
i added counters requests. every time user clicks on "more results", functions fetch , _filterresponses called; therefore should have same count. console.log shows _filterresponse somehow slower fetch. have
... fetchcount = 220 fetchcount = 221 fetchcount = 222 filterresponsecount = 98 fetchcount = 223 filterresponsecount = 99 ...
i wonder if changing parameters in iis such queue length help?
edit #2 (2015-10-01) :
i tried slow down fetch function way :
fetch: function(request) { console.log("idsvaluesqueryreadstore : fetch"); this.fetchcount++; console.log("fetchcount = ", this.fetchcount); this.sleep(1000); ... }, sleep: function(miliseconds) { console.log("go sleep"); var currenttime = new date().gettime(); while (currenttime + miliseconds >= new date().gettime()) { } console.log("wake up!"); },
by slowing down fetch function, saw fetchcount , filterresponse count closer, codes ends crashing after 100 clicks...
edit #3 (2015-10-06) :
it seems figured out. problem within our wcf code : database connexions not closed properly. every click on "more result" generated unclosed connexions , exceeded allowed limit.
Comments
Post a Comment