[omniORB] Detecting activated servants...

Duncan Grisby duncan@grisby.org
Mon Sep 30 16:38:01 2002


On Friday 27 September, Marcus MacWilliam wrote:

[ Please don't send HTML email to the list. At least one subscriber is
on a boat with a slow satellite link, and every time there's an HTML
mail to the list, I get a warning (as list administrator) telling me
I'm sending too much stuff to the boat. Aside from that, it
unnecessarily bloats messages for everyone. ]

[...]
> I thought our wrappers handled everything automatically, but I have
> started to get omniorb messages in my server output, telling me
> I am trying to delete an object that is still active.
> 
> This is strange because the object is deleted in a method that has
> already called release() (our own), which calls
> poa->deactivate_object(id) for the servant in question.

deactivate_object cannot always deactivate an object immediately, so
there is no guarantee about when an object will be fully deactivated,
and therefore safe to delete.

The thing to do is to write your own implementations of the servant's
_add_ref and _remove_ref functions, so you know when the POA has
released its reference to the servant. You don't have to actually
delete the object when it's been deactivated, just mark it as safe to
delete.

Cheers,

Duncan.

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