[omniORB] object deactivation

Stefan Seefeld seefeld@sympatico.ca
Mon, 18 Jun 2001 15:34:01 -0500


Renzo Tomaselli wrote:

> Is it safe to do the equivalent with POA when a servant inherits from
> RefCountServantBase, e.g.:
> 
> Foo::close() {
>   PortableServer::POA_var poa = _default_POA();
>   PortableServer::ObjectId_var id = poa->servant_to_id(this);
>   poa->deactivate_object(id);
> }
> 
> since after deactivation this servant itself is no longer existing ?
> Or is there any conflict or better solution ?

no, your code is fine. deactivate_object will only mark the object as
'to be deactivated' which leads to all new incoming requests to it to be
refused, while all pending requests are finished, inclusively
the one above, before the deactivation takes effect (and the inclusive
servant deletion).

Regards,
		Stefan