Hi!
Ole Husgaard wrote:
> When doing simultaneous calls to the same stateful
> session bean I sometimes get a RemoteException:
> "Application Error: tried to enter Stateful bean with
> different transaction context"
>
> This exception is correct; that is exactly what I am
> trying to do. In current CVS this is thrown from
> StatefulSessionInstanceInterceptor line 169.
> However, I would prefer that this exception not be
> thrown, and the InstanceInterceptor instead wait
> until the current invocation is finished.
Well, tell that to the EJB spec writers. We follow the specs, which say
that an exception must be thrown on reentrant calls to stateful
sessions.
> Looking into the source, I see no easy fix apart
> for a busy-wait loop (and a busy-wait loop is IMHO
> too expensive here).
> Not seeing an easy fix, and knowing that this does
> not happen with entity beans, I turn to see how this
> is done in EntityInstanceInterceptor. To my horror
> this looks like it _is_ using a busy-wait.
> IMO Simon has done a fine job on the cache and locking
> issues, but maybe there is still a to-do here?
I know that the interceptor used to be busy-wait-less, but as I review
the code again, yes, it does indeed do a busy wait.
Simone, can you explain why this is? It's not good.
> For both stateful session and entity we want to wait
> if the call is re-entrant (StatefulSessionInstance-
> Interceptor line 189, and EntityInstanceInterceptor
> line 162), and we want to wait until the context
> transaction is null or the same as the MI transaction
> (StatefulSessionInstanceInterceptor line 169, and
> EntityInstanceInterceptor line 140).
See above, the stateful session behaviour may not be changed. At least
not in JBoss core. If you want to do local changes, that's fine, but you
may not add them to JBoss CVS. Sorry Ole :-(
/Rickard
--
Rickard Öberg
Email: [EMAIL PROTECTED]