Subject | Re: [Firebird-Architect] Re: External procedures: implementation proposal. |
---|---|
Author | David Jencks |
Post date | 2005-07-26T17:32:46Z |
On Jul 26, 2005, at 9:47 AM, Roman Rokytskyy wrote:
places, and indeed I haven't found any way to implement JTA
transactions without a thread local. It doesn't mean it's a good idea:
for JTA the requirements basically come from C programming circa 1990
(maybe earlier). Jim has argued against thread locals repeatedly and
to the extent I understand what he is talking about I completely agree
with him.
Here, I don't see why you would even think of thread locals. You have
some method that may need a resource, why not just give it the resource
to start with rather than forcing it to look it up? Even EJB 3 is
moving towards some dependency injection/IOC concepts.
thanks
david jencks
>> Opinions differ on this :-). I think thread locals are a dreadfulThe j2ee specs effectively require you to use thread locals in several
>> 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
> Geronimo?
>
> 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?
places, and indeed I haven't found any way to implement JTA
transactions without a thread local. It doesn't mean it's a good idea:
for JTA the requirements basically come from C programming circa 1990
(maybe earlier). Jim has argued against thread locals repeatedly and
to the extent I understand what he is talking about I completely agree
with him.
Here, I don't see why you would even think of thread locals. You have
some method that may need a resource, why not just give it the resource
to start with rather than forcing it to look it up? Even EJB 3 is
moving towards some dependency injection/IOC concepts.
thanks
david jencks
>
> Roman
>
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>