CORBA::Object::_non_existent() ???

Sai-Lai Lo S.Lo@orl.co.uk
Fri, 9 Jan 1998 11:18:16 GMT


Hi. This is another grey area in the spec. that I have applied one of the
several possible intepretations.

Accoring to CORBA 2 spec. sec. 7.2.5:

> boolean non_existent();
> The non_existent operation may be used to test whether an object (e.g. a
> proxy object) has been destroyed. It does this without invoking any
> application level operation on the object, and so will never affect the
> object itself. It returns true (rather than raising
> CORBA::OBJECT_NOT_EXIST) if the ORB knows authoritatively that the
> object does not exist, and otherwise it returns false.

The first question is can the operation raise a system exception?

Like most operations in the spec. there is no mention of whether a system
exception can be raised. The C++ language mapping gives more information
but is still incomplete. I tried to intepret the spec. consistently,
i.e. if there is no explicit statement to the contrary, these operations
can raise a system exception. For instance, it is clearly stated in the C++
mapping that release() and is_nil() must not throw system exceptions, and
so they do not. Unfortunately, non_existent() is not covered by the current
mapping so it is up to each ORB to apply its own intepretation.

Suppose the operation is not allowed to raise a system exception, than
according to the spec. the ORB should return false in your case. This is
not very helpful. If what you want is ensure that the object exists before
you invoke on it, this is exactly the opposite behaviour you want. In
other words, the system exception is providing you with extra information
that cannot be conveyed through the return value of the operation. 

The ORB raises a COMM_FAILURE in this case because in the process of
executing the operation, the communication with a remote object cannot be 
established. In your case, because there is no process listening on the
socket.

Regards,

Sai-Lai



>>>>> Igor Cunko writes:

> I have trouble with CORBA::Object::_non_existent().I have primitive client and
> server. This is basicaly procedure I use.

> Client call server->logIn(CORBA::Object_ptr obj)
> I put obj in array.
> Go trough array and invoke a[i]->_non_existent()
> Function exits.
> Client finish execution.
> Another time call to a[i]->_non_existent() raise COMM_FALIURE instead return
> false. Is this correct behavior or failure in my logic.