[omniORB] about make a servant both CORBA client and CORBA server

zhang ji zsfunl@yahoo.com
Fri Jul 5 16:39:00 2002

Hi Luke,

Thanks for your help. Yes it can use only one ORB. I
am sorry for one error where I declare the orb twice!

The CORBA specification said :"The ORB_init operation
may be called any number of times and shall return the
same ORB reference when the same ORBid string is
passed." So if we call more than one ORB_init(), it
will return the same orb.That is why you say it should
use only one ORB? And that is why when I
shutdown/destroy orb2 the program will crash.

--- Luke Deller <ldeller@xplantechnology.com> wrote:
> Hi Shifeng,
> Yes, you can (and should) use only one ORB.  You say
> this does not work for 
> you... what problems did you have?
> Regards,
> Luke.
> zhang ji wrote:
> > I have a problem on how to make a servant as both
> a
> > CORBA client and CORBA server.
> > 
> > I published one servant a as CORBA object A,
> within
> > the publish program I init one ORB orb1 and make
> it
> > orb1->run(); in one function of the servant a , I
> need
> > to call another CORBA object. In this functin I
> init
> > another ORB orb2, by using
> orb2->string_to_object(ref)
> > I access another CORBA object, but I can not
> shutdown
> > the orb2 or destroy it after finishing the remote
> call
> > in the function.
> > If I orb2->shutdown, it seems the whole CORBA
> object A
> > will also be destroied after the calling.
> > If I orb2->destroy, the client will block there.
> > 
> > But when I either call the orb2->shutdown or call
> the
> > orb2->destroy, it works well.
> > 
> > So do I really need not to call the shutdown or
> > destroy? And Can I use one ORB only (such as only
> > orb1, I tried but it does not work)?
> > 
> > Thanks,
> > Shifeng

Do You Yahoo!?
Sign up for SBC Yahoo! Dial - First Month Free