webtier@glassfish.java.net

Re: Sequential sending of ajax calls. Can we make it concurrent?

From: <forums_at_java.net>
Date: Tue, 20 Sep 2011 20:52:47 -0500 (CDT)

we have simplifed the issue, now we have 2 WAR files and 2 portlets (1 per
WAR).
each of the portlets makes a call to jsf.ajax.request in a setTimeout
function
*Code:*
 

setTimeout('autoSubmit(\''+namespace+'\','+parsedData+')',1)
autoSubmit() uses the jsf.ajax.request() function.
all java script requests fired in sequence.
however, at the backend, we find that the bean methods are fired this way..
the following are sample log statements that we placed at the beginning and
end of the backing bean methods.
portlet A action start
portlet A action end
portlet A action start
portlet A action end
portlet A action start
portlet A action end
.. (repeats for a few times)
portlet B action start
portlet B action end
After which the front end is refreshed with new data.
Portlet A is the slower portlet.
After looking into the jsf.ajax.request code, we find the following:
*Code:*
 

// if there is already a request on the queue waiting to be processed.. //
just queue this request if (!req.que.isEmpty()) { if (!req.fromQueue) {
req.que.enqueue(req); return; } } // If the queue is empty, queue up this
request and send if (!req.fromQueue) { req.que.enqueue(req); }
the above is from jsf-uncompressed.js in the jsf-impl jar file.
Please correct me if i am wrong but it appears that the basis for icefaces
ajax concurrent calls is a queue (FIFO)?
On another train of thought,
since the requests are different, does anyone know why the second request is
not fired immediately after the first request is?
Thanks!


--
[Message sent by forum member 'erctheanda']
View Post: http://forums.java.net/node/845180