[omniORB] issues with multiple orbs in a server gui app

Jason Dolan jason at pcc.com
Wed Jan 18 10:06:49 GMT 2006


Hello, I have this server gui application ( I'm using wxWidgets).  When 
ever a new window is created I create a new orb using ORB_init(), create 
a new thread, then run that newly created orb in that thread calling 
run() on that orb.  So, basically each new window that is created has a 
CORBA server.  Everything works great except for when I try to close a 
single window.  When I close a window I want to destroy the orb 
corresponding to that server as well, so I call shutdown(0) on the orb, 
then after the thread quites I call destroy() on the orb.  The problem 
is, when I call shutdown on that orb, it seems to shutdown ALL the orbs 
in all the other STILL RUNNING windows.

To give a little background....  my window class is called MyFrame and 
is derived from:
  - wxFrame(a wxWidgets frame),
  - wxThread(wxWidgets thread implementation),
  - virtual POA_WidgetObject (my object defined in the IDL),
  - virtual PortableServer::RefCountServantBase

The class has a member variable:
  - CORBA::ORB_var m_pORB;

When each window is created, its m_pORB is assigned using ORB_init() as 
shown below:
m_pORB = CORBA::ORB_init(argc, (char **) argv);
CORBA::Object_var pObj = m_pORB->resolve_initial_references("RootPOA");
PortableServer::POA_var pPOA = PortableServer::POA::_narrow(pObj);
PortableServer::POAManager_var pMgr = pPOA->the_POAManager();	
pMgr->activate();
PortableServer::ObjectId_var oid = 
pPOA->activate_object((POA_WidgetObject *)  this);
pObj = pPOA->id_to_reference(oid.in());
m_strIOR = (const char* ) m_pORB->object_to_string(pObj.in());

I'm definitely a noob when it comes to CORBA, and maybe I'm not even 
implementing this the correct way.  But what it comes down to is that I 
need a CORBA server running in each instance of a created window.  When 
a window is destroyed, ONLY that associated CORBA server should be 
destroyed.



More information about the omniORB-list mailing list