[omniORB] Beginner's question about corbaloc
fischer.c at atlas.de
fischer.c at atlas.de
Mon Nov 15 15:30:02 GMT 2004
Hi,
i just wrote a little test program with VisiBrker 5.2.1 that does the following:
1. create a POA
2. create and activate a servant in this POA
3. create an object reference 'obj1' by id_to_reference()
4. create an object reference 'obj2' by the servant's _this() method
Seems like the VisiBroker developers haven't read the specs as carefully as Duncan did, because what i get is two different object references:
obj1->_is_equivalent(obj2) returns false and with a closer look to the objects i see that one is activated in my POA, the other one in the root POA.
So be careful when using an ORB other than omniORB (or at least when using VisiBroker). Strange things may happen when you use _this().
Best Regards
Clemens
-----Ursprüngliche Nachricht-----
Von: omniorb-list-bounces at omniorb-support.com [mailto:omniorb-list-bounces at omniorb-support.com] Im Auftrag von Fischer, Clemens
Gesendet: Montag, 15. November 2004 13:50
An: clarke.brunt at yeomannavigation.co.uk; omniORB-list at omniorb-support.com
Betreff: [omniORB] Beginner's question about corbaloc
Hi,
i just found it in http://www.omg.org/docs/formal/03-06-03.pdf,
the current version of the C++ Language Mapping, in chapter
1.37.5. 'Skeleton Operations'. Thanks for pointing that out.
After reading the third chapter i understand what happens in the
case of an already activated servant incarnating exactly one object.
But the last sentence is a bit confusing:
"The POA is gotton by invoking _default_POA() on the servant".
Would this mean that _default_POA() in this situaton returned a POA
other than the root POA, although it is not overriden?
Best Regards
Clemens
-----Ursprüngliche Nachricht-----
Von: omniorb-list-bounces at omniorb-support.com [mailto:omniorb-list-bounces at omniorb-support.com] Im Auftrag von Clarke Brunt
Gesendet: Montag, 15. November 2004 12:36
An: omniORB-list at omniorb-support.com
Betreff: Re: [omniORB] Beginner's question about corbaloc
<fischer.c at atlas.de> wrote:
>Hi Duncan,
>
>thanks for clarifying this point. In chapter 11.6 'Servant IDL Type',
>Henning & Vinoski write that _default_POA() can be overriden to enable
>_this() to activate objects in a POA other than the root POA.
>But this seems only necessary if the object is not already activated.
>
>Where can i find further information on this topic? The POA chapter in
>the OMG CORBA specification doesn't say really much.
>
>Are you sure that what you say applies to other ORBs, too? I feel like
>having had this double activation problem with a quite old version of
>VisiBroker.
I've always used what is stated in the spec "C++ Language Mapping
Specification", as _this() is presumably specific to C++. The PDF I
downloaded from OMG (possibly out of date) is dated June 1999, and says it
aligns with CORBA 2.3.
Section 1.36.5 (Skeleton Operations) appears to say precisely what Duncan
said, with the addition that if you use _this() within a method invocation,
then you get "...the object reference for the target CORBA object it is
incarnating for that request.".
I hadn't previously appreciated the point that (outside a method
invocation), then if the servant only has a single activation, then you'll
get the object reference for that one (rather than possibly inadvertently
causing another activation in another POA). Relying on this sounds a bit
dodgy to me, as it would break if you happened some time later to have
multiple activations. Far better, if you are going to use _this(), and you
are using a POA other than the root POA, to implement _default_POA() to
return the one you want to use.
So: one would hope that what Duncan said applies to other ORBs too. As for
whether or not it does...
--
Clarke Brunt, Principal Software Engineer, Yeoman Navigation
_______________________________________________
omniORB-list mailing list
omniORB-list at omniorb-support.com
http://www.omniorb-support.com/mailman/listinfo/omniorb-list
_______________________________________________
omniORB-list mailing list
omniORB-list at omniorb-support.com
http://www.omniorb-support.com/mailman/listinfo/omniorb-list
More information about the omniORB-list
mailing list