[omniORB] Date: Fri, 11 Jan 2002 11:24:23 +0100

Duncan Grisby dgrisby@uk.research.att.com
Fri, 11 Jan 2002 11:54:34 +0000


On Friday 11 January, =?iso-8859-1?Q?Andr=E9n_Clas?= wrote:

> I have discovered a pretty weird interoperability problem betwen
> OmniORBpy and TAO 1.2. THe problem occurs when I send a reference to a
> callbackobject from the client to the server (Subscribing) and when I at
> a later stage want to delete this objectreference (Unsubscribing). The
> Unsubscribing is performed by from the client side again reffering to
> the object reference which is stored at the server-side in a <map>.

This has nothing to do with interoperability. Object references cannot
be compared with each other, so there cannot be any guarantee that you
will find the original reference in the map. The fact that it ever
works is luck, due to implementation details in the ORB. You _can_
compare object references with _is_equivalent(), but even that is not
guaranteed to work -- if it returns true, the objects are definitely
the same; if it returns false, it just means the ORB can't tell if
they're the same or not.

The correct way to deal with this situation is to use some sort of
token that is returned to the client when it registers its callback.
The token can either be a number or string, or a reference to an
object in the server. See Henning and Vinoski's book for coverage of
this sort of thing.

Cheers,

Duncan.

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