[omniORB] Use of _non_existent

Duncan Grisby dgrisby@uk.research.att.com
Wed, 13 Mar 2002 18:54:17 +0000


On Tuesday 12 March, Wilson Jimmy - jiwils wrote:

> I've been using _non_existent to determine if an object is around or not for
> some time, and today I was told that was an invalid way to do this (the
> servants are using TAO 1.1.6).  I was quoted the following from the CORBA
> bible.  I do not have the book, so I was curious if some on this list could
> enlighten me as to what context (no pun intended) this quote is taken from:
> 
> The use of _non_existent is not a valid way of determination of validity of
> one of the director objects because we have not overidden the _non_existent
> call, and the default behavior of this call is *false* (p 453 Advanced Corba
> Programming in C++, Henning & Vinoski).

There isn't a quote like that in my copy of H&V. I looked at all the
entries for "_non_existent" in the index, and couldn't find that. Page
453 does talk about the fact that the default implementation is to
return false.

I suspect that what it's on about is that you can run into troubles
with default servants.  The default implementation of _non_existent()
returns false, meaning that the object exists. If you have a default
servant, its default behaviour is therefore to reply false for every
object that could ever be activated in the default servant's POA.
That probably isn't the right thing -- the default servant
implementation should probably look at PortableServer::Current to see
if the requested object id is one that exists. I don't think this is
an issue in any other situation.

H&V also assert that a client ORB doesn't necessarily contact the
server in response to a _non_existent call, if it can work out the
correct answer some other way. I can only think of one circumstance
when it could do that, which is after a previous _non_existent call
returned true or an invocation raised OBJECT_NOT_EXIST. In any other
situation, I think it will have to contact the server. omniORB always
contacts the server, even after a previous true reply or
OBJECT_NOT_EXIST.

Cheers,

Duncan.

-- 
 -- Duncan Grisby  \  Research Engineer  --
  -- AT&T Laboratories Cambridge          --
   -- http://www.uk.research.att.com/~dpg1 --