Evan Ireland wrote:
> dan benanav wrote:
> >
> > ><concrete-example>
>
> BeanA and BeanB are installed on the same server
>
> client invokes methodA() on BeanA
>
> methodA() on BeanA starts threadA
>
> threadA.run() invokes methodB() on BeanB
>
> server crashes because BeanB doesn't have the correct thread context
> (some expected values in thread-local storage are missing)
>
> </concrete-example>
>
If I were to invoke a bean on methodB() on BeanB from threadA I would look up the home
object for BeanB, get the bean object and then invoke the method.
Context initialContext = new InitialContext();
BeanBHome beanBHome =
(BeanBHome)narrow(initialContext.lookup(�java:comp/env/ejb/beanB�),
BeanBHome.class);
beanB = beanBHome.findByPrimaryKey(1);
beanB.methodB();
This would start a new transaction.
What would be wrong with that?
So the call to methodB does not occur in the same transaction context as the call to
methodA.
dan
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".