Results 1 to 3 of 3

Thread: Synchronous Ajax Calls

  1. #1

    Default Synchronous Ajax Calls

    From other posts I understand that Ext doesnt support Synchronous Ajax Calls. But my requirement is , I will be processing or calling webservice call which may take few minutes at server side. So if I use asynchronous call it will get timedout for 50000 milliseconds which results in failure of the ajax call.

    Can anyone suggest me a way that my screen should wait till the server completes its process. Increasing timeout will not solve my problem because server may process records for more time next time.

  2. #2
    Ext User zhegwood's Avatar
    Join Date
    Dec 2007
    Location
    Boulder, CO Suburbia (Lafayette)
    Posts
    388

    Default

    The only thing I can think of is to chunk the data-getting into smaller batches. Send a start value in the params for the ajax call & on the server-side start at that value and return, say, 1000 records at a time. Then in the response send a completed flag. Wrap that in a while loop and you should be good.

    On a side note, you might run into problems on the js side actually doing anything with that amount of data once you get it... Unresponsive script messages could happen if you do any looping.

  3. #3

    Default

    I do not know what web-service you are talking to, or if you have any control over it. But, if you do...

    If the task being performed takes a long time to complete, then in effect it is what we old-timers would call "a batch job."

    //JSTASK JOB (123,456),'BLAST FROM THE PAST'
    //STEP1 EXEC DSN=...


    (whups! wrong decade!)

    Seriously... you ought to define one web-service request that starts the background activity and gives you some handle that you can then use to check on it. Other web service requests let you poll the status of the activity, and maybe to define some kind of pro-active notification. Finally, other requests would let you determine how many results there are, and to obtain slices of the information. Finally, a request would allow you to indicate to the mainfram... I mean, to the host... that the output can now be discarded.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •