POA with USER_ID policy bug



Hi all!

	I've found out bug(or feature?) during creating new child POA with
USER_ID policy. If you will invocate CORBA object method from the same
thread than everything should be fine, but if not(from another process
or, may be, from another thread) than seems ORB will return
OBJECT_NOT_EXIST exception. So, what do you think?


Here is my modifications of echo-srv.c, so you can make test of
that bug :

@@ -73,25 +73,45 @@
 void
 echo_srv_start_poa(CORBA_ORB orb, CORBA_Environment *ev)
 {
+   PortableServer_POA  root_poa;
     PortableServer_POAManager mgr;
+   CORBA_PolicyList *plf;

     the_orb = orb;
-    the_poa =
(PortableServer_POA)CORBA_ORB_resolve_initial_references(orb, 
+    root_poa =
(PortableServer_POA)CORBA_ORB_resolve_initial_references(orb, 
       "RootPOA", ev);
-    mgr = PortableServer_POA__get_the_POAManager(the_poa, ev);
+
+   plf             = CORBA_PolicyList__alloc();
+   plf->_maximum   = 1;
+   plf->_length    = 1;
+   plf->_buffer    = CORBA_PolicyList_allocbuf(plf->_length);
+   CORBA_sequence_set_release(plf, CORBA_TRUE);
+   plf->_buffer[0] =
(CORBA_Policy)PortableServer_POA_create_id_assignment_policy(
+           root_poa, PortableServer_USER_ID, ev);
+
+    mgr = PortableServer_POA__get_the_POAManager(root_poa, ev);
+
+   the_poa = PortableServer_POA_create_POA(root_poa, "MyPOA", mgr, plf,
ev);
+
     PortableServer_POAManager_activate(mgr, ev);
     CORBA_Object_release((CORBA_Object)mgr, ev);
+
+   CORBA_Policy_destroy(plf->_buffer[0], ev);
+   CORBA_Policy_destroy(plf->_buffer[1], ev);
+   CORBA_free(plf);
 }

 CORBA_Object
 echo_srv_start_object(CORBA_Environment *ev)
 {
+   the_objid = PortableServer_string_to_ObjectId ("MyOID", ev);
+     POA_Echo__init(&poa_echo_servant, ev);
     if ( ev->_major ) {
    printf("object__init failed: %d\n", ev->_major);
    exit(1);
     }
-    the_objid = PortableServer_POA_activate_object(the_poa,
+    PortableServer_POA_activate_object_with_id(the_poa, the_objid,
            &poa_echo_servant, ev);
     if ( ev->_major ) {
    printf("activate_object failed: %d\n", ev->_major);


Thanks,
Dmitry


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]