Hi!
> Rickard, ok, this is you with the same problem on a different view.
> I guess you still can't "see" multiple threads in one Tx... strange
Ah, now I see where the confusion comes from.
The main thing is: multiple physical threads, yes, but only one logical
thread of execution. The transaction, or "call flow", may involve several
physical threads as beans call beans in other servers or in the same server
or whatever, but there is only one "flow". The river never splits into two
concurrent flows of execution.
Hence, if we come to a point where a context is used by the same tx as we
are in there are two things that can happen (which is the if(ctx.isLocked)
check):
1) The context is not locked -> the context has been used before in this tx,
but it is not a reentrant call
2) The context is locked -> the current thread of execution ("call flow")
has already been to this instance and locked it, hence it is a reentrant
call (which may or may not be ok)
So, basically, the else branch of the isLocked() check should throw a
RemoteException if isCallAllowed returns false.
Do you see now?
/Rickard