Subject Re: External procedures: implementation proposal.
Author Roman Rokytskyy
> The j2ee specs effectively require you to use thread locals in
> several places, and indeed I haven't found any way to implement JTA
> transactions without a thread local.

Also, for your information, SQLJ requires to obtain context connection
in Java method like this:

public static void someProcedure(int valueA, String valueB) {
Connection connection =


So, the code first has to call the method (in our case reflection) and
only then access to the connection happens. I see no chance to solve
this without TLS in this case. But sure, this can be done already in
Java code.