Yes,
that solves my problem. Btw. I'm looking on results from stress tests
right now and after 6 hous of running the most frequented object from
OWB is WrappedValueExression with ~100 000 instances but it is no
problem, it's expeceted result due to big jsf views.
Regards,
Martin Kočí
Gurkan Erdogdu píše v So 14. 08. 2010 v 08:42 -0700:
> Good catch Martin,
>
> I think it is enough to put following into WebContextService, WDYT?
>
> private void destroyRequestContext(ServletRequestEvent request)
> {
> .......
>
> conversationContext.set(null);
> conversationContext.remove();
> }
>
>
>
>
> ________________________________
> From: Martin Koci <[email protected]>
> To: [email protected]
> Sent: Sat, August 14, 2010 6:20:19 PM
> Subject: WebBeansPhaseListener doesn't release ConversationContext for long
> running conversation
>
> Hi,
>
> this use case probably leads to odd behaviour of conversation:
>
> 1) in first JSF request/response, in invoke application, I start long
> running conversation with conversation.begin()
>
> 2) WebBeansPhaseListener.afterPhase(PhaseEvent) does some operation with
> conversation object, but does not it **release** from ThreadLocal
>
> 3) then I create a GET request to other view in the same application but
> without any operation with conversation,
> WebBeansPhaseListener.afterPhase calls
> ContextFactory.destroyConversationContext(); and destroys same instance
> of ConversationContext because it is still in ThreadLocal!
>
>
> I think WebBeansPhaseListener.afterPhase should contains something like
> this:
>
> else
> {
> //Conversation must be used by one thread at a time
> ConversationImpl owbConversation = (ConversationImpl)conversation;
> owbConversation.updateTimeOut();
> //Other threads can now access propogated conversation.
> owbConversation.setInUsed(false);
>
> ContextFactory.releaseButNOTDestroyConversationContext();
>
> }
>
>
> What do you think?
>
>
> Regards,
>
> Martin Kočí
>