Apologies if I don't understand your problem, but isn't this what java.lang.ThreadLocal is supposed to be all about?

I use them to hold database sessions and the current
context for a request; it seems to work painlessly.
It had some performance problems in java 1.2 days, but
now works efficiently.

Artem Gr wrote:

By the way, I found a solution to "shared context-aware objects"
problem, that no one here mentioned.
It's very simple (and is often used, I just overlooked it).
It is to put current context into map of threads:
Map threadContexts = new HashMap();
threadContexts.put( Thread.currentThread(), theContext );


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to