Subject Re: External procedures: implementation proposal.
Author Roman Rokytskyy
> Opinions differ on this :-). I think thread locals are a dreadful
> hack and should be eliminated wherever possible. They are normally
> a way to tell component C about the context available in A without
> telling B, the guy in the middle.

Not only in this case. How did you implement the following code in

InitialContext ctx = new InitialContext();
UserTransaction tx = ctx.lookup("UserTransaction");

I doubt that there are no TLS here. Same approach I consider for the
callbacks. What is wrong with it?