I noticed something interesting.
I was told (and from what I read) that it is safe to hold request-scope variables in a ThreadLocal
(let's say you don't have access to the request object and can't use request attributes)
Well, it seems to work (at least when I checked in tomcat). e.g. Even if I have 10 threads in the pool, the thread local variables seem to live only for the scope of a single request. I mean, even if I see the same thread name (let's say I have 10 in the pool, so after 10 requests I'm ought to see some repeat) each request "magically" resets all thread local variables for that thread.
Is that true?
Is every time a request thread is returned to the pool, it clears all thread local vars? How?