Re: Removing ThreadLocal variables

2015-04-13 Thread Leo Donahue
On Mon, Apr 13, 2015 at 6:57 PM, Konstantin Kolinko wrote: > 2015-04-14 2:28 GMT+03:00 Leo Donahue : > > > > I think I prefer the Listener approach better. > > Filters are better. > > With Filter there is a guarantee that finally block is executed in the > same thread. > > With RequestListener th

Re: Removing ThreadLocal variables

2015-04-13 Thread Konstantin Kolinko
2015-04-14 2:28 GMT+03:00 Leo Donahue : > On Mon, Apr 13, 2015 at 5:25 PM, Christopher Schultz < > ch...@christopherschultz.net> wrote: >> >> The good news is that you are thinking about this in the correct way: >> that requests are handled by (usually) one thread and you have to >> clean the Threa

Re: Removing ThreadLocal variables

2015-04-13 Thread Leo Donahue
On Mon, Apr 13, 2015 at 5:25 PM, Christopher Schultz < ch...@christopherschultz.net> wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA256 > > Leo, > > The good news is that you are thinking about this in the correct way: > that requests are handled by (usually) one thread and you have to > c

Re: Removing ThreadLocal variables

2015-04-13 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Leo, [re: Removing ThreadLocal variables] Uh, oh. On 4/13/15 10:50 AM, Leo Donahue wrote: > Tomcat 7.0.61 Java 1.7.0_75 > > Scenario: > > Class1 static Type ThreadLocal variable static Type > getThreadLocal(){...} static T

Removing ThreadLocal variables

2015-04-13 Thread Leo Donahue
Tomcat 7.0.61 Java 1.7.0_75 Scenario: Class1 static Type ThreadLocal variable static Type getThreadLocal(){...} static Type setThreadLocal(){...} static void destroy(){variable.remove} Class2 static Type ThreadLocal variable static Type getThreadLocal(){...} static Type setThreadLo