[omniORB] POA::deactivate_object and id_to_reference

Duncan Grisby duncan at grisby.org
Thu Nov 6 11:02:38 GMT 2003


On Wednesday 29 October, Rene Jager wrote:

> I have the following problem:
> 
> after a call to
> 
>     poa->deactivate_object(object_id)
> 
> I expected that
> 
>     poa->id_to_reference(oid)
> 
> would throw ObjectNotActive, but it does not. Both calls are within the
> same method.

If the object really is deactivated, id_to_reference will throw
ObjectNotActive. However, there is no guarantee that deactivation has
completed when deactivate_object returns, since deactivation is often
done by a separate thread.

The best way to know when the last request on an object has finished,
and it has been successfully deactivated is to use a POA with a
ServantActivator. That way, the etherealize method will be called when
the object is deactivated.

Cheers,

Duncan.

-- 
 -- Duncan Grisby         --
  -- duncan at grisby.org     --
   -- http://www.grisby.org --



More information about the omniORB-list mailing list