openwebbeans-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Маринчук Андрей Игоревич <marinchu...@tii.ru>
Subject Conversation scope and multiple requests
Date Mon, 07 Apr 2014 10:34:54 GMT
Hi

I having problem with @ConversationScope bean and h:commandLink component without ajax.
My application uses openwebbeans-1.1.8, myfaces-2.1.12, myfaces-extcdi-1.0.5, openejb-jstl-1.2,
primefaces-4.0 and some other required libs.
The servlet container is Weblogic-10.3.6 (and apache-tomcat-7.0.53 for development needs).

Most conversation scoped beans in my application are used in forms which are submitted by
ajax requests, so jsf implementation send queues requests.
But there h:commandLink component which actionListener is binded to the download method (which
writes the content of generated file to the output stream and calls FacesContext.responceComplete)
of conversation scoped bean. This functionality cannot be done with ajax requests and according
to the application logic, I cannot exclude the conversation usage. So, there is no guarantee
that user will not see the 500 error due to BusyConversationException (throwed from org.apache.webbeans.jsf.WebBeansPhaseListener).
I tried to move actionListener method to RequestScoped bean, but BusyConversationException
throwing due RESTORE_VIEW phase, so this did not help.
My current workaround is disabling link by javascript for several seconds after the first
onclick event. By it looks like dirty hack. Conversation scoped beans could live in non-ajax
requests and there are no way to limit such requests from the browser to single queue, so
just throwing BusyConversationException without waiting is not good tactics.

Does it exists any way to avoid BusyConversationException (i.e. hung up the thread till conversation
unlock or just allow multiple threads to use single conversation or, may be, there any servlet
filter which could organize single request queue per conversation)?

Regards,
Andrey

Mime
View raw message