[omniORB] A new/remove (lifecycle?) question

Duncan Grisby dgrisby@uk.research.att.com
Tue, 04 Jan 2000 16:33:26 +0000


On Tuesday 4 January, Bruce Cameron wrote:

[...]

> obj = factory->new_A();
> aClass = A::_narrow(obj);
> for (i = 0; i < 5; i++) {
>   obj = factory->new_B();  // <============ dies here
>   B_var bClass = B::_narrow(obj);
> 
>   aClass->addB(bClass);
> }

In what way does it die?  I can't see anything wrong with the code
you've given. You don't actually need to do the narrowing, having
declared the return types in IDL, but it shouldn't hurt.

> I know there's a bug in my logic somewhere. Do I have
> to use a lifecycle move() when adding Bs to A? Does the
> client have to maintain object relationships rather
> than doing it on the server side?

You don't need to worry about the lifecycle move() unless you are
migrating objects (which in this example you are not). Indeed, you
don't need the omniORB lifecycle extensions at all, so it's best if
you don't use them (if you are).

Can you give more information about your set-up, and exactly what goes
wrong?

Cheers,

Duncan.

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