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

Björn Hagemeier bjoernh at uni-paderborn.de
Wed Jan 18 16:25:20 GMT 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Jason,

please see my comment below.


Regards,

Björn

Jason Dolan wrote:
> 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. 

The CORBA standard does not require ORB_init to return a newly created
ORB. In fact most implementations will always return only one. Thus, if
you shutdown that single ORB, the other threads/windows can't access it
anymore.

 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.
> 
> _______________________________________________
> omniORB-list mailing list
> omniORB-list at omniorb-support.com
> http://www.omniorb-support.com/mailman/listinfo/omniorb-list


- --
+----------------------------+-----------------------------------------+
| Björn Hagemeier            | Tel:               +49 (5251)  87 12 69 |
| Otto-Wels-Str. 34          | Mobil:             +49 ( 173) 878 48 77 |
|                            | E-Mail:        bjoernh at uni-paderborn.de |
|                            | Homepage:            www.b-hagemeier.de |
| 33102 Paderborn            | ICQ:                          464 20 23 |
+----------------------------+-----------------------------------------+
| PGP-Key:          1A967704                                           |
| Key Fingerprint:  5FF6 973A 46FC DB6C E9AF  A324 DE2E A874 1A96 7704 |
+----------------------------------------------------------------------+
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFDzl3f3i6odBqWdwQRApgjAJ9XnWkOPj81m6q852wuBUSf6GS8dACePjhk
+aLYqh95RW8iwsBPlrihicg=
=cFaw
-----END PGP SIGNATURE-----
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bjoernh.vcf
Type: text/x-vcard
Size: 299 bytes
Desc: not available
Url : http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20060118/d116dc68/bjoernh.vcf


More information about the omniORB-list mailing list