[ 
https://issues.apache.org/jira/browse/OWB-467?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12918118#action_12918118
 ] 

Martin Kočí commented on OWB-467:
---------------------------------



You are not logged in, and do not have the permissions required to comment on 
the selected issue as a guest.

To comment on an issue first login or signup for an account.
If you wish to use the comment text you have typed (shown below), please copy 
it now. This text will be lost when you leave this screen.

> item 1 ) We have discussed this already. Non-faces request means that 
> non-faces get requests i.e, not post-back
 > requests. We support this case using cid parameter. Please look at 
 > ConversationAwareViewHandler

Ok, I don't understand what non-faces means in this case, JSF spec. says 
"Non-Faces Request—A request that was sent to an application component (e.g. a 
servlet or JSP page), rather than directed to a Faces view". And CDI spec: "A 
web conversation context in addition to the three standard web contexts defined 
by the Java Servlets specification" (not addition to JSF contexts like flash or 
view scope) so my initial thought was: OWB must handle conversation without JSF 
-> if no JSF runtime is present phase-listener based solution will not work -> 
move solution in higher servlet-level as filter.


> Item 2) If an exception occurs, it will be timed out and removed by the 
> container finally. Therefore I see no problem.
> Overall, I see no problem.

JSF cannot guarantee that there will be render response phase as
reaction to faces request. For this reason:

1) before restore view : lock -> 2) after render response: unlock

does not apply because it is not "atomic" and conversation can stay locked even 
no thread is using it.

An example:

deploy jsf2sample from OWB and change 
org.apache.webbeans.jsf2.ConversationData.getNumber() to:

public int getNumber()
 {
     if (i > 10) {
     throw new NullPointerException();
     }
        return i++;
 }

NPE simulates code bug. Then click "Start conversation" and then "Show number" 
-> Error page appears. Then enter URL 
http://localhost:8080/jsf2sample/conversation.jsf?cid=1 again -> 
"javax.enterprise.context.BusyConversationException: Propogated conversation 
with cid=1 is used by other request. It creates a new transient conversation" 
appears.
Every such use case creates a new conversation with converation.isUsed = true 
but no thread is really using those conversations.

Is this description more explanatory?

> Move init/destroy of conversation from phase listener to servlet filter
> -----------------------------------------------------------------------
>
>                 Key: OWB-467
>                 URL: https://issues.apache.org/jira/browse/OWB-467
>             Project: OpenWebBeans
>          Issue Type: Bug
>          Components: Context and Scopes
>    Affects Versions: 1.0.0-alpha-2
>         Environment: OWB trunk
>            Reporter: Martin Kočí
>            Assignee: Gurkan Erdogdu
>            Priority: Critical
>
> OWB code for init/destroy conversation is in a phase listener. It is not 
> safe: see http://markmail.org/message/oz7f7jnchwvrcw65. This phase listener 
> approach also does not allow conversation for non faces request, but CDI spec 
> says: "The conversation scope is active: during all standard lifecycle phases 
> of any JSF faces or non-faces request". So this issue is critical for two 
> reasons:
> 1) it does not allow conversation for non-faces request (specification says 
> it must)
> 2) it can lock conversation forever (or only for timeout period?) and exhaust 
> memory with locked conversations
> Proposed solution: move code to servlet filter as discussed at 
> http://markmail.org/message/oz7f7jnchwvrcw65

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to