[omniORB] How to destroy objects

Duncan Grisby duncan at grisby.org
Wed Jul 3 10:37:34 BST 2013


On Tue, 2013-07-02 at 15:18 +0200, Stefan Walter wrote:

> how do I destroy objects in omniORB which are not longer required.

Can you clarify what you are talking about destroying?  There are at
least two things you might mean:

1. On the client side, release the object reference.
2. On the server side, deactivate the object and delete the servant.

In CORBA, those two things are totally separate concerns. Client object
references are reference counted, and the Echo_var holder automatically
releases its reference when it goes out of scope.

The lifetime of server-side object activations is completely unaffected
by whether any clients hold object references. If you want to get rid of
the server-side objects, you must write server-side code to do so. It is
common to define a destroy() method in your IDL, for example, so a
client can dispose of an object when it has finished with it. To
deactivate an object, you call deactivate_object on the POA it is
activated within.

In more complex situations, you might want to implement some sort of
evictor or timeout that automatically deactivates objects that are no
longer in use. It all depends upon what you want the semantics to be.

Cheers,

Duncan.

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





More information about the omniORB-list mailing list