Ken,

The no-args constructor should work when your caller is in the same process as the 
callee. (Well, in Borland Enterprise Server, this holds true for remote clients as 
well - props if specified are passed as JVM args). But I digress:

- Calls to the ENC are intra-VM calls. The implementation - as laid down by the spec 
could not be otherwise - since the ENC is private to an EJB (process specific).

- Borland Enterprise Server has always optimized calls to the ENC. The overhead of 
getting something from the ENC is the same as the overhead of a (local) method call 
that returns a value from a Hashtable. The overhead of RPCs can also be avoided if the 
naming service (global jndi lookups) runs in the same process as the AppServer.

-krish

----- Original Message -----
From: Ken Delong <[EMAIL PROTECTED]>
Date: Tuesday, March 4, 2003 5:04 am
Subject: Re: EJB-INTEREST Digest - 27 Feb 2003 to 28 Feb 2003 (#2003-52)

> Krish,
>
> This is something that has bugged me, also.  It also bugs me when
> peopleload up their InitialContext constructors with hashtables,
> when the spec
> guarantees that a no-arg constructor must return the correct
> Context for
> finding the ENC.
>
> I'd heard rumors that in later versions of the spec, the idea of a
> globalJNDI namespace for anything but remote EJBs (which have to
> be visible in
> COSNaming) might be explicitly forbidden.
>
> A couple questions for you:
> 1. You said that an ENC lookup must always be in-process.  Is that
> mandatedby the spec?  I don't recall ever hearing that before.
>
> 2. I've always wondered whether app server vendors can put little
> optimization hooks into ENC calls that they can't do with global JNDI
> lookups.  Do you do anything special?
>
> Ken DeLong
> [EMAIL PROTECTED]
>
>
> > Date:    Fri, 28 Feb 2003 11:54:52 +0100
> > From:    Krishnan Subramanian <[EMAIL PROTECTED]>
> > Subject: how not to look up local Ejbs
> >
> > All,
> >
> > Many EJB developers who are building applications based on
> > the EJB 2.x specification seem to be making this (serious)
> > mistake; and worse do not realize that their code is relying
> > on an AppServer bug.
> >
> > The problem itself is a simple one:
> >
> > When looking up an EJB with local interfaces, developers use
> > the physical JNDI name of the local enterprise bean in lieu
> > of the specification defined environment naming context(ENC).
> <snip>
>
> ===========================================================================
> 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".
>
>

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

Reply via email to