dev@glassfish.java.net

ThreadPools + Security + JTA + ...

From: Michael Hollatz <michael.hollatz_at_profitbricks.com>
Date: Wed, 06 Jul 2011 10:42:54 +0200

Hi *,

I am currently in the need of a thread pool that is security + JTA + ...
agnostic, meaning that new threads *mustn't* inherit security-,
transaction- or other container-/state-related information.

If I configure a new thread pool within my own code, what set of things
do I have to be aware of?

I already implemented something that does throw away any SecurityContext
(which is an inheritable thread-local). However, I recently found out
that the JTA handling also uses some ThreadLocals and so my thread pool
could potentially break a lot of stuff here.

Would it be safe to use a thread-pool directly configured in the
domain.xml? Does the implementation handle that kind of things?


Best regards and thanx for any help,

Michael