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

2010-08-07 Thread Adriano dos Santos Fernandes (JIRA)

[ 
https://issues.apache.org/jira/browse/WICKET-2846?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=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.



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

2010-07-15 Thread Erik van Oosten (JIRA)

[ 
https://issues.apache.org/jira/browse/WICKET-2846?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12888729#action_12888729
 ] 

Erik van Oosten commented on WICKET-2846:
-

Juliano Viana on the WIcket user mailing list at 2010-07-14 15:55 wrote:

Hi everyone,

I know this issue has already been debated and that a decision was made to
revert this change in a future version of Wicket.
However, the discussions about this issue were centered on the fact starting
threads in web applications is not a good idea anyway, and hence this would
not break applications that are not already broken.
I have found a real case where this breaks an innocent application:
redeploying an application based on  Wicket 1.4.9 on Glassfish 3.0.1 causes
a memory leak due to the use of InheritableThreadLocal.
The problem is that when the application accesses a JDBC resource for the
first time, Glassfish lazily starts a timer (connector-timer-proxy) that has
an associated thread. This timer is started  from the web request processing
thread. This thread never dies, and inherits a reference to the Wicket
Application object.
This only happens on redeployments, but it really hurts development as you
keep having to restart Glassfish due to OOM exceptions.
Removing the InheritableThreadLocal resolves the issue completely and makes
development really smooth again.
So if you are using Wicket 1.4.9 with Glassfish v3 you should consider
patching it until a new Wicket release is out.

Regards,
  - Juliano


 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.



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

2010-05-28 Thread Sven Meier (JIRA)

[ 
https://issues.apache.org/jira/browse/WICKET-2846?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12872957#action_12872957
 ] 

Sven Meier commented on WICKET-2846:


There might be reasons to prefer an ITL but IMHO the provided use case example 
is contrived.
I'd suggest moving your thread creation out of your UI tier:

public class MyPage extends Page {
  @SpringBean
  private MyService service;

  //perform a polling of long running process triggered by a button click
  onClickButton() {
  service.executeLongRunningProcessAndReturnImmediately();
  }
} 

 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.



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

2010-05-28 Thread Alexandru Objelean (JIRA)

[ 
https://issues.apache.org/jira/browse/WICKET-2846?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12872967#action_12872967
 ] 

Alexandru Objelean commented on WICKET-2846:


The main reason why this cannot be moved outside the UI tier is:
- the use case is to have some sort of component which launch a long running 
task and have a clear visual indication of the status (in progress, complete, 
not started). 

One more  thing I want to point out is that though there was a long discussion 
about the problem the ITL may cause, nobody actually managed to prove it:
http://apache-wicket.1842946.n4.nabble.com/vote-Revert-WICKET-2846-td2226987i20.html




 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.



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

2010-04-26 Thread Alexandru Objelean (JIRA)

[ 
https://issues.apache.org/jira/browse/WICKET-2846?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12861013#action_12861013
 ] 

Alexandru Objelean commented on WICKET-2846:


Hi Igor!
Thanks for the fix. I have a question, why this fix is not a part of 1.4.8 
release?


 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: Igor Vaynberg
Priority: Minor
 Fix For: 1.4.9


 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. 
 Thanks!
 Alex

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