<br><br><div class="gmail_quote">On Wed, Mar 25, 2009 at 6:28 AM, Duncan Grisby <span dir="ltr">&lt;<a href="mailto:duncan@grisby.org">duncan@grisby.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">&gt; I see no point in checking number of activations then... (activations_.size()<br>
&gt; == 1)<br>
<br>
</div>That&#39;s essential for the &quot;as long as the servant is not incarnating<br>
multiple CORBA objects&quot; bit.<br>
<div class="im"></div></blockquote><div><br>Hmm... According to my understanding of terminology &quot;CORBA object&quot; is a virtual entity described by an interface in idl file. Servant instance is an incarnation of CORBA object (i.e. it implements given interface). When servant implements multiple interfaces -- this is what called &quot;incarnates multiple CORBA objects&quot;. I.e. number of activations have nothing to do with it. But I could be wrong, of course...<br>
<br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="im">
</div>I think the confusion is around the intention of the _this() method.<br>
_this() is not intended to return *a* reference corresponding to a<br>
servant, it&#39;s intended to return *the* reference corresponding to a<br>
servant. i.e. the one single reference that makes sense for a servant.<br>
If a servant is activated once in one POA, that is clearly the reference<br>
you want. If a servant is activated multiple times (regardless of<br>
whether in just one POA or multiple POAs), there is no single correct<br>
reference to return, so _this() throws an exception.<br>
<br>
It&#39;s only in the case that a servant is not activated at all that the<br>
question of &quot;which POA?&quot; arises. If you have to ask &quot;which POA?&quot;, then<br>
the answer is the one returned by _default_POA(). That&#39;s why it&#39;s called<br>
default -- it&#39;s the one to use if you don&#39;t have any other POA to<br>
choose.<br>
<div class="im"></div></blockquote><div><br>All this is confusing and dangerous, even we we asume that there s no logical problems in standard&#39;s wording... I would prefer simple and straightforward approach -- if not current, then grab default POA, check policies then return ref or throw.<br>
<br> <br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="im">
&gt; :-) I knew it... I bet this enormous amount of code has the same problem we do<br>
&gt; -- if for some reason _this() is called on deactivated object it will be<br>
&gt; (unexpectedly) activated in the RootPOA.<br>
<br>
</div>Yes, but it&#39;s not omniORB&#39;s job to protect you from all bugs in<br>
application code. There is plenty of code out there that looks just like<br>
the simple example I&#39;ve used above, and that is trivially correct.<br>
</blockquote><div><br>Majority of code probably does not create additional POAs (no POAs -- no problems). <br>I do not try to tell that omniORB has to protect me from this, this is standard&#39;s job -- just wanted to know why omniORB&#39;s behaviour is different from what my eyes see in standard -- clearly there is at least one problem in the document.<br>
</div></div><br>-- <br>Sincerely yours,<br>Michael.<br>