[omniORB] about corba object destroy

zhang ji zsfunl@yahoo.com
Sat, 23 Mar 2002 16:17:04 -0800 (PST)


Hi all,

My question is how to implement destroy() for CORBA
object with all default POA policy under RootPoa.
Below is one of possible interface.

interface test{
   void useit();
   void destroy();
}

I use the default RootPoa with all the default policy.
Then I implement the test_impl::destroy() as below:

test_impl::destroy(){
   _remove_ref();
}

The test_impl is inherited from the
RefCountServantBase.

In my client porgram I just got the CORBA Object and
first run useit(); then run destroy(); then destroy
the orb.
The problem is I can run client twice, The first time
everything is OK, the seconde time everything is also
OK but with one Error information:

omniORB: ERROR -- A servant has been deleted that is
still activated.
      id: root<0>

If the third time the registered main() crash.

My question is why we can run it twice, since the
first run we have already reduce the count ref to 0(so
the servant should be deleted when the orb destroy as
my understanding).
Next question is there existing a nice method to
implement the destroy wihtout the help of servant
managers.(I think the default POA policy does not
provides the USE_SERVANT_MANAGER)

Thanks
shifeng

__________________________________________________
Do You Yahoo!?
Yahoo! Movies - coverage of the 74th Academy Awards®
http://movies.yahoo.com/