> |The three cases I see are:
> |* Reentrant call within one tx. This one is simple: just check if
> |the ctx is
> |locked and the locking tx is the same as the current
>
> :) you looked at teh code? it is not sufficient (if the instance was
> calling and is reentrant is false then we can't detect)
Sorry, I'm not following here. What exactly is the problem?
> |* Reentrant call through A, calling B which has RequiresNew, which calls
A.
> |This one will be resolved through tx timeout (it is a form of deadlock).
> |>From a reentrancy point of view the timeout exception follows the spec
> |semantics of reentrancy (i.e. exc is thrown).
>
> yes a timeout will prevent a deadlock
>
> |* Reentrant call without any tx's at all, which would require the
callstack
> |to do properly. This one is tougher since there are no timeouts. We
should
> |probably do a manual timeout of this in the instanceinterceptor.
>
> well the "callstack" can carry ctx ids or cachekey ids and we can detect a
> "duplicate". I don't see anything since the first case is not enough, you
> need the actual stack of ctx to do comparisons at every bean and throw a
> 'reentrant' exception if needed... overkill imho
Well, it would also be possible to do a "fake tx", i.e. just add some kind
of id to pass along the call chain. When we lock we set it (just as we
associate the ctx with the tx on lock) so that we can check if a locked
instance has the same tx or fake tx=reentrant call.
So, it would be possible (although you seem to be saying that the tx check
don't work), but not exactly portable.
/Rickard