Hi!

marc fleury wrote:
> |I'm pretty sure that the above is something that is not allowed, i.e.
> |forking threads does not mean that the tx is in the forked thread as well.
> 
> without the forking, which i think is perfectly valid, you tend to think of
> the transaction in a "reductive" way.. the transaction is something larger,
> many clients can participate in a transaction and their scheduling is not "a
> priori" (like implicitely if you only have your "logical thread")

The above makes no sense to me. Can you be more precise in what you are
talking about, and how it relates to forking of threads within a
transactional scope?

> |My case still holds IMO: there is only one logical thread of execution per
> |transaction.
> 
> YHO is not going to cut it... show me the law, and I am not even sure what
> it means... how are you going to go from one thread to the other, what does
> your "logical thread" use to do that?  can you give an example (codish) of
> how that "scheduler" works (outside our container of course, in multiple VMs
> ;-)

How does one thread go to another within one logical thread of
execution? Simple:
Client A starts a transaction X.
Client A calls bean Foo in server Xyzzy. Xyzzy uses a thread to execute
the invocation on Foo.
During the invocation Foo calls bean Bar in server Zyxxel. Zyxxel uses a
thread to execute the invocation on Bar.
FREEZE. Bar invocation has not completed. At this point the X tx is
involving three threads: one in the client, one in Xyzzy, and one in
Zyxxel. Still only one thread of execution though since we have not
created any threads or similar.
UNFREEZE. Bar invocation completes. Return to Xyzzy/Foo.
Foo invocation completes. Return to A.
A commits X.
Done.

Do you see now? There was one logical thread of execution beginning in A
and using Foo and Bar on its way to commit. During that time three
physical threads were involved. 

This is the rule: there can be many physical threads per tx (and I never
stated otherwise), but there can only ever be one logical thread of
execution per transaction (and yes, I have checked the JTA spec now and
it says nothing about forked threads inheriting tx's).

/Rickard

-- 
Rickard �berg

Email: [EMAIL PROTECTED]
http://www.telkel.com
http://www.jboss.org
http://www.dreambean.com


Reply via email to