[ 
http://issues.apache.org/jira/browse/MYFACES-543?page=comments#action_12355607 
] 

Marcus Schiesser commented on MYFACES-543:
------------------------------------------

thank you for your answer mathias. 
i see that reusing the component tree is a problem, if they don't clean up 
their state - although so far i did not have any problems with the components i 
use (i am using also the UIData). 
IMHO the patch could be of value for others, if they do not want to serialize 
(for performance reasons, or if they want to store some unserializable objects 
in the component tree) the view and therefore need some synchronizing (in that 
case this is also necessary for the faces components, therefore i would like to 
have it in the myfaces package). how about making the patch customizable, or 
adding the changed servlet as another class name to the package ?
If the rendering of the view doesnt change the state, which i assumed, the 
output should be the same with two simultanous requests as with one request as 
the first request will finish the state changing and the second will do the 
rendering as soon as the first has changed the state.
so the behaviour should be the same as one request and a refresh - at least 
that was my intention. 


> Problems handling simultaneous request from the same session
> ------------------------------------------------------------
>
>          Key: MYFACES-543
>          URL: http://issues.apache.org/jira/browse/MYFACES-543
>      Project: MyFaces
>         Type: Bug
>   Components: Implementation
>     Versions: 1.0.9m9
>     Reporter: Marcus Schiesser
>      Fix For: Nightly
>  Attachments: semaphore.patch, sync.patch
>
> If someone tries to do simultaneous client requests from the same HttpSession 
> instance (i used a direct resubmit in the form tag's onsubmit handler which 
> leads to two simultaneous requests) it will lead to concurrent access 
> problems.
> During my tests, it almost any time crashed in the UIViewRoot implementation. 
> The reason is that it is not thread-safe which could be easily solved by 
> synchronising the 4 process.... methods and the queueEvent method.
> But the question is where to put the synchronisation, i also tried 
> synchronising the service method of the FacesServlet class, so that only one 
> HttpSession could run at the time (IMHO something desirable). That way the 
> simultaneous request are processed one after the other.
> But a further question arises then: How MyFaces handles the problem if two 
> identically request are processed in the lifecycle - is this appart from the 
> rendering (in my tests SocketExceptions occured as the connection has been 
> reset before) a problem? Does it affect the state?
> What are your opinions concerning this topic?

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira

Reply via email to