dan benanav wrote:
>
> Evan Ireland wrote:
>
> >
> > > > </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?
> >
> > The naming context object may be aware of whether or not it is running within
> > the server (or just in a client), and the lookup call could crash the server!
> > +64 4 934-5856
>
> How would it be aware that it is running on the server? This call will be made from
>a Thread
> that I create, not one that the container creates.
The Thread that you create will use a vendor-supplied implementation of
javax.naming.Context, javax.ejb.EJBObject etc. These implementations may be
aware whether they are running within the server because they may use a
vendor-internal API to detect if they are running within the server.
________________________________________________________________________________
Evan Ireland Sybase EA Server Engineering [EMAIL PROTECTED]
Wellington - New Zealand +64 4 934-5856
===========================================================================
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".