[ 
https://issues.apache.org/jira/browse/WICKET-5998?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14962223#comment-14962223
 ] 

Martin Grigorov commented on WICKET-5998:
-----------------------------------------

I remember discussing this with Igor and Matej back in 1.3.x/1.4.x days. It is 
a known issue.
Here are some links:
 - WICKET-4012
 - http://markmail.org/message/krbwbcva3cxm6za7

In all discussions I remember of the short answer was: this is the safer 
approach.
But as Matej mentioned in the second link we can add a request flag so the 
second attempt is ignored.  Just like onConfigure() works.

> Page is detached twice in same AJAX request
> -------------------------------------------
>
>                 Key: WICKET-5998
>                 URL: https://issues.apache.org/jira/browse/WICKET-5998
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 7.0.0
>            Reporter: Martijn Dashorst
>            Priority: Minor
>
> While debugging some code I noticed that detaching happens twice during the 
> same (AJAX) request.
> First through `ListenerInterfaceRequestHandler.detach()` and next through 
> `AjaxRequestHandler.detach(IRequestCycle)`.
> The following stack traces show the code paths.
> {code}
> Thread [qtp1297836716-57] (Suspended (breakpoint at line 858 in MyWebPage))   
>       MyWebPage.onDetach() line: 858  
>       MyWebPage(Component).detach() line: 1162        
>       PageAndComponentProvider(PageProvider).detach() line: 330       
>       ListenerInterfaceRequestHandler.detach(IRequestCycle) line: 128 
>       RequestCycle$HandlerExecutor.detach(IRequestHandler) line: 876  
>       RequestCycle$HandlerExecutor(RequestHandlerStack).detach() line: 180    
>       RequestCycle.onDetach() line: 641       
>       RequestCycle.detach() line: 594 
>       RequestCycle.processRequestAndDetach() line: 297        
>       WicketFilter.processRequestCycle(RequestCycle, WebResponse, 
> HttpServletRequest, HttpServletResponse, FilterChain) line: 261     
>       WicketFilter.processRequest(ServletRequest, ServletResponse, 
> FilterChain) line: 203     
>       WicketFilter.doFilter(ServletRequest, ServletResponse, FilterChain) 
> line: 284   
> Thread [qtp1297836716-57] (Suspended (breakpoint at line 858 in MyWebPage))   
>       MyWebPage.onDetach() line: 858  
>       MyWebPage(Component).detach() line: 1162        
>       AjaxRequestHandler$1(PartialPageUpdate).detach(IRequestCycle) line: 417 
>       AjaxRequestHandler.detach(IRequestCycle) line: 277      
>       RequestCycle$HandlerExecutor.detach(IRequestHandler) line: 876  
>       RequestCycle$HandlerExecutor(RequestHandlerStack).detach() line: 180    
>       RequestCycle.onDetach() line: 641       
>       RequestCycle.detach() line: 594 
>       RequestCycle.processRequestAndDetach() line: 297        
>       WicketFilter.processRequestCycle(RequestCycle, WebResponse, 
> HttpServletRequest, HttpServletResponse, FilterChain) line: 261     
>       WicketFilter.processRequest(ServletRequest, ServletResponse, 
> FilterChain) line: 203     
>       WicketFilter.doFilter(ServletRequest, ServletResponse, FilterChain) 
> line: 284   
> {code}
> Is this something that can be prevented? If you have a big component tree, 
> detaching twice can be quite expensive.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to