A script has executed for longer than the default timeout period of 15 seconds

412 views
Skip to first unread message

PC

unread,
Aug 1, 2008, 7:31:49 AM8/1/08
to Flex India Community
Hi,

I am getting this error "A script has executed for longer than the
default timeout period of 15 seconds" when I retrieves the data using
web service call. The amount of data is large about 24000 records and
one record has size around 8kb.

When I tries to set this much amount of data in a chart, then also
this error occurs.

This is the default behavior of flash player that it do not allow to
execute scripts more then 15 seconds. I have search on most of the
forums but I could not able to get the problem resolved.

Do any one have solution for this problem.

Thanks in advance.

Prashant Choudhary

<mx:AnandVardhan/>

unread,
Aug 1, 2008, 7:45:32 AM8/1/08
to Flex India Community
You are doing something which went in an infinite loop. try looking on
the recent changes you made. try commenting it out and then running.

Anand
(Adobe Certified Developer)

PC

unread,
Aug 1, 2008, 7:57:57 AM8/1/08
to Flex India Community
Hi,

The same code works if amount of data is less (up to 15000 records).
But when the number of records are increased error occurs.

Here is the two methods which some times throw this exception when
amount of data is large
In first method I gave call to apache-cfx web service which returns
large amount of data.
I n second method I am doing nothing but setting the data provider of
chart

This is the code which I have used to retrieved data

private function getData():void{

try{
var selStation:String=station.selectedItem.toString();
var stationCaheExists:Boolean=stationCacheExist[selStation] as
Boolean

trace("stationCaheExists=="+stationCaheExists)
if(isCustomerCacheExist==true && stationCaheExists==true){
trace("Data is set from cache");
}else{
trace("calling get data from web service");

srv.addEventListener(ResultEvent.RESULT,getDataResult)

var op:AbstractOperation=srv.getOperation("getData")
op.send(station.selectedItem);

CursorManager.setBusyCursor();


}
}catch(e:Error){
trace("Error occurred :"+e.getStackTrace())
Alert.show("Error occured while retrieving data. Please try
again.","Error");
}
}

The result of above method is stored in a collection and set in a
chart later using method below

private function setDataInChart(evt:Event):void{
try{
if(resultView.lineChart!=null){
resultView.lineChart.dataProvider=null;

resultView.lineChart.dataProvider=stationAggtypeCombArray[currentStation
+aggregation.selectedItem.data] as ArrayCollection
}
}catch(e:Error){
trace("Error in setDataInChart: "+e.getStackTrace())
}
}

Ajay Chhaya

unread,
Aug 1, 2008, 8:36:50 AM8/1/08
to flex_...@googlegroups.com
I'm not sure if it works but you can set scriptTimeLimit property of Application
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" scriptTimeLimit="60">
and see if it works, you can check more details here

http://livedocs.adobe.com/flex/201/html/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Book_Parts&file=performance_118_12.html


---------------------
Ajay Chhaya

www.ajaychhaya.com
--------------------------------

PC

unread,
Aug 1, 2008, 10:01:39 AM8/1/08
to Flex India Community
I already tried this option (scriptTimeLimit="60") but no luck.
Reply all
Reply to author
Forward
0 new messages