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

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

Thinking on this problem I realize that if we use a flag to indicate that the 
page is detached then there is no place where to reset this flag. Usually this 
place is #detach() itself.
Using 'transient' won't help because the pages used in the last request are 
kept alive in the http session.

The only way I see is to add extra logic in 
org.apache.wicket.request.RequestHandlerStack#detach() and track the detached 
pages for IPageClassRequestHandler's.
Any better ideas?

> 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