Foros de discusión

Portlet Namespace not unique when making parellel request with AJAX

Jason Chen, modificado hace 13 años.

Portlet Namespace not unique when making parellel request with AJAX

Junior Member Mensajes: 62 Fecha de incorporación: 22/07/10 Mensajes recientes
Hi,

I have an instanceable portlets that onload will make an AJAX request to the server. Not to be confused with the ajaxable portlet. Basically Liferay renders part of the portlet, then the portlet behind the scene making an AJAX request to get some more data.

Everything works well until I dropped two of the instances to a page and reload it. These two instances will make async request to the server in parallel and the return result has the same portlet namespace.

I have checked the parameter I send to the server and they contain the right parameter: p_p_id=CurrentResearch_WAR_portletsresearch_INSTANCE_2pI4 and p_p_id=CurrentResearch_WAR_portletsresearch_INSTANCE_6Gyt respectively on each portlet.

If I changed the javascript to make a synchronous request, I got different portlet namespace on each portlet.
Even if I added a slight delay on each request, I would get a different portlet namespace as well.

This seems like a race condition problem. Any thought?

Thanks,
Jason