[omniORB] omniORB 3.00pre1 problem with _is_a (_real_is_a)

Christof Meerwald cmeerw@htl.fh-sbg.ac.at
Mon, 22 Nov 1999 12:34:13 +0100


Hi David,

On Mon, 22 Nov 1999 10:02:34 +0000 (GMT), David Riddoch wrote:
>On Mon, 22 Nov 1999, Christof Meerwald wrote:
>
>> There seems to be a related problem in omniInternal.cc (omni::createObjRef,
>> line 558):
>> 
>>   proxyObjectFactory* pof = proxyObjectFactory::lookup(mostDerivedRepoId);
>> 
>>   if( pof && !pof->is_a(targetRepoId) &&
>>       strcmp(targetRepoId, CORBA::Object::_PD_repoId) ) {
>>     if( omniORB::trace(10) )
>>       omniORB::logf("Cannot create reference -- %s is\n"
>>                     " not a base for %s.", targetRepoId, mostDerivedRepoId);
>> 
>> 
>> This returns a nil reference if the information supplied in
>> mostDerivedRepoId isn't really the most derived interface (e.g. if
>> mostDerivedRepoId says omg.org/CORBA/Object but it really is a more derived
>> interface)
>
>There is however one case where this might give the wrong answer.  If the
>object has been replaced by one of a more derived type which does have
>'targetRepoId' as a base class (as well as 'mostDerivedRepoId') then we
>would fail to create the reference even though the object does now support
>the desired interface.  However we cannot be expected to know this at the
>client, and I think it is perfectly acceptable to fail here.

According to the specs (CORBA 2.3.1: 99-10-07, 13.6.2 Interoperable Object
References: IORs) this behaviour is not acceptable:

  ... Therefore, the type ID in the IOR can only be interpreted by the
  client as a hint that the object supports at least the indicated
  interface. The client can succeed in narrowing the reference to the
  indicated interface, or to one of its base interfaces, based solely on the
  type ID in the IOR, but must not fail to narrow the reference without
  consulting the object via the "_is_a" or "_get_interface"
  pseudo-operations.


Currently we have the strange situation that is_a succeeds but narrow
fails...


bye, Christof

-- 
Don't hate yourself in the morning... sleep until noon!