> 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.

I now realize that the above is only half-true. It is true in the case of
transactions being used, but if there are no transactions used one can get
to the isLocked check else branch, and the call may be allowed even though
the other call was from another !thread of execution!.

To fix this the first context wait if-statement should not only check for
separate transactions holding the context, but also if there is no tx
running and the context isLocked. If it is locked (but not within a tx) then
we should also wait, which is basically what the !isCallAllowed branch does
currently.

I'm rambling, so if you understand the above that's good, but I certainly
understand if you don't :-)

/Rickard



Reply via email to