Re: ThreadLocals, context listeners and classloader leaks

2012-01-28 Thread Rainer Jung
On 26.01.2012 18:00, Jess Holle wrote: On 1/26/2012 10:38 AM, Mark Thomas wrote: OK. ThreadLocals have no place in a web application. Period. If a programmer insists on using them, then it is their responsibility to clean up the mess they leave behind. Tomcat's memory leak detection and prevent

Re: ThreadLocals, context listeners and classloader leaks

2012-01-26 Thread Pid
On 26/01/2012 17:48, Caldarale, Charles R wrote: >> From: Pid [mailto:p...@pidster.com] >> Subject: Re: ThreadLocals, context listeners and classloader leaks > >> Imagine the fiendishly clever and machiavellian applications >> we'd have to debug if you did that.

RE: ThreadLocals, context listeners and classloader leaks

2012-01-26 Thread Caldarale, Charles R
> From: Pid [mailto:p...@pidster.com] > Subject: Re: ThreadLocals, context listeners and classloader leaks > Imagine the fiendishly clever and machiavellian applications > we'd have to debug if you did that... Job security. - Chuck THIS COMMUNICATION MAY CONTAIN CO

Re: ThreadLocals, context listeners and classloader leaks

2012-01-26 Thread Pid
On 26/01/2012 17:30, Caldarale, Charles R wrote: >> From: Jess Holle [mailto:je...@ptc.com] >> Subject: Re: ThreadLocals, context listeners and classloader leaks > >> That said, there could and arguably should be another choice: > > I'll suggest something more

RE: ThreadLocals, context listeners and classloader leaks

2012-01-26 Thread Caldarale, Charles R
> From: Jess Holle [mailto:je...@ptc.com] > Subject: Re: ThreadLocals, context listeners and classloader leaks > That said, there could and arguably should be another choice: I'll suggest something more radical: define a class such as ScopeLocal where values are added to an

Re: ThreadLocals, context listeners and classloader leaks

2012-01-26 Thread Jess Holle
On 1/26/2012 10:38 AM, Mark Thomas wrote: OK. ThreadLocals have no place in a web application. Period. If a programmer insists on using them, then it is their responsibility to clean up the mess they leave behind. Tomcat's memory leak detection and prevention code goes some way to clearing up th

Re: ThreadLocals, context listeners and classloader leaks

2012-01-26 Thread Mark Thomas
On 26/01/2012 15:16, Patric Rufflar wrote: >> I have no idea what the phrase "take the use of" means; what are you >> trying to say? > > I'd like to know if there's some statement from the tomcat team if the > usage of ThreadLocals within contextInitialized() is discouraged or even > not supported

RE: ThreadLocals, context listeners and classloader leaks

2012-01-26 Thread Patric Rufflar
Am 26.01.2012 16:59, schrieb Caldarale, Charles R: No; again, a ThreadLocal is _not_ inherited, but an InheritableThreadLocal is. These are different animals. 1. A InheritableThreadLocal is (extends) a ThreadLocal. 2. Surprise: A InheritableThreadLocal is _not_ used for the Thread.inheritable

RE: ThreadLocals, context listeners and classloader leaks

2012-01-26 Thread Caldarale, Charles R
> From: Patric Rufflar [mailto:pat...@rufflar.com] > Subject: RE: ThreadLocals, context listeners and classloader leaks > 1. contextInitializer() sets value A to the ThreadLocal X > in thread main > 2. childs threads get spawned from main thread, now we have > more than one

RE: ThreadLocals, context listeners and classloader leaks

2012-01-26 Thread Patric Rufflar
I have no idea what the phrase "take the use of" means; what are you trying to say? I'd like to know if there's some statement from the tomcat team if the usage of ThreadLocals within contextInitialized() is discouraged or even not supported. ??? A ThreadLocal is _not_ inherited from the pa

RE: ThreadLocals, context listeners and classloader leaks

2012-01-26 Thread Caldarale, Charles R
> From: Patric Rufflar [mailto:pat...@rufflar.com] > Subject: ThreadLocals, context listeners and classloader leaks > It's unspecified in the servlet spec 2.5 if a servlet context > listener is allowed to take the use of ThreadLocals during > contextInitialized(). I have no idea what the phras