You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Adriano dos Santos Fernandes (JIRA)" <ji...@apache.org> on 2010/08/07 20:32:17 UTC

[jira] Commented: (WICKET-2846) Store Application in InheritableThreadLocal instead of ThreadLocal

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

Adriano dos Santos Fernandes commented on WICKET-2846:
------------------------------------------------------

This issue went "fixed" in 1.4.9 then reverted in 1.4.10.

This ticket was changed to "won't fix" against 1.4.10. This seems as a bad documentation practice. It would need another ticket.

> Store Application in InheritableThreadLocal instead of ThreadLocal
> ------------------------------------------------------------------
>
>                 Key: WICKET-2846
>                 URL: https://issues.apache.org/jira/browse/WICKET-2846
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>            Reporter: Alexandru Objelean
>            Assignee: Jeremy Thomerson
>            Priority: Minor
>             Fix For: 1.4.10
>
>         Attachments: wicket-application-leak.tar.gz
>
>
> Is there any particular reason why Application class wouldn't be stored in 
> InheritableThreadLocal instead of ThreadLocal? The problem is that I need to 
> be able to access Application class from a thread created when a button is 
> pressed. Using InheritableThreadLocal instead of ThreadLocal would solve 
> this problem. 
> Use case example:
> public class MyPage extends Page { 
>   @SpringBean 
>   private MyService service; 
>   //perform a polling of long running process triggered by a button click 
>   onClickButton() { 
>     new Thread() { 
>       run() { 
>         service.executeLongRunningProcess(); 
>       } 
>     }.start();   
>   } 
> } 
> The following example won't work well if the Application is not stored in InheritableThreadLocal. The reason why it doesn't work, as I understand that, is because @SpringBean lookup depends on Application instance which is not accessible from within the thread. Having it stored inside of ITL would solve the problem. 
> Thanks!
> Alex

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