I'm working on a project using JBoss Seam 2.2.6, JSF 1.2 and RichFaces 3.
Users of the application must enter data in a form, and for certain fields it is necessary to make calls to the backend to recalculate other values based on the data entered.
Back-end calls are made using the AJAX support RichFaces offers, for example, using <a4j: support>
for onchange events.
This is the Jsf/RichFaces code:
<h:selectOneMenu value="#{managedBean.someValue}" >
<s:selectItems value="#{managedBean.entityList}" var="_item"
label="#{_item.label}"
itemValue="{item.value}"
/>
<a4j:support
event="onchange" // handling onchange event
status="waitStatus" // "please wait.." pop up blocks UI
eventsQueue="afjQueue" // ajax requests queue
ignoreDupResposes="true" // avoid similar requests
action="#{managedBean.onInputChange()}"
reRender="somePanel"
oncomplete="showErrors();"
/>
</h:selectOneMenu>
The problem is that the user could click on different fields of the form or on different buttons, make multiple requests to the server in a short period of time, and Seam does not support concurrent calls to the same conversation scoped component (if it happened a ConcurrentCallToConversation error would occur )
To avoid this we have done the following:
1) adding a a4j:queue for queueing AJAX requests
2) setting ignoreDupResposes="true"
to avoid "similar" requests.
3) setting seam core property concurrent-request-timeout="5000"
(info about this property. This property causes a request to have exclusive control of the component for 5 seconds)
4) adding a a4j:status that shows a "please wait..." dialog between request starts and request ends, blocking the UI
Because the user experience is affected by a pop up that appears every time an ajax request is made, i want to delete the alternative 4.
So my question is: Is it guaranteed that there will not occur a concurrent call to conversation if I use a queue of requests and a large enough timeout for exclusive access? meaning that using the first 3 items would be enough.