[omniORB] CORBA::Object::_non_existent()??? - does not follow spec.

Kruczkowski, Marzenna MKruczk@thestar.ca
Fri Sep 27 16:32:01 2002


This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.


--==_15385061517066==_
Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C2663A.4308C620"

------_=_NextPart_001_01C2663A.4308C620
Content-Type: text/plain;
	charset="iso-8859-1"


Hi. Recently, I was switching from using micoORB to omniORB. And, I have
encountered a problem with _non_existent. The behaviour is different for
different ORBs.
MicoORB returns Boolean omniORB raises COMM_FAILURE exception.

While, I agree with Sai-Lai that an exception could provide you with more
info. The problem is the _non_existent raises COMM_FAILURE exception when
communication between client and server is lost as well as when only the
object reference is stale. I think would be a better choice to use
OBJECT_NOT_EXIST when object reference is invalid and TRANSIENT when the
server cannot be reached. That would truly provide more info. and prevented
the confusion. 

 "Advanced CORBA..." book by MH,SV  provides description for both
exceptions:
OBJECT_NOT_EXIST
"This exception is an authoritative indication that the reference for the
request is stale (denotes a non-existent object. ..."

COMM_FAILURE
"This exception is raised if communication is lost while an operation is in
progress. At the protocol level, the client sends a request to the server
and then waits for a reply containing the results. If the connection drops
after the client has sent the request but before the reply has arrived, the
client-site ..."
"Some ORBs incorrectly raise COMM_FAILURE instead of TRANSIENT if they
cannot establish a connection to the server. If this is the case for your
ORB, you should put pressure on the vendor to fix it."

Regards,
Marzenna.


----------------------------------------------------------------------------
Marzenna Kruczkowski - mkruczk@thestar.ca
 tel. 416 869-4606  fax. 416 869-4804
Corporate Information Technology 
Torstar Media Group

Hi. This is another grey area in the spec. that I have applied one of the
several possible intepretations.

Accoring to CORBA 2 spec. sec. 7.2.5:

> boolean non_existent();
> The non_existent operation may be used to test whether an object (e.g. a
> proxy object) has been destroyed. It does this without invoking any
> application level operation on the object, and so will never affect the
> object itself. It returns true (rather than raising
> CORBA::OBJECT_NOT_EXIST) if the ORB knows authoritatively that the
> object does not exist, and otherwise it returns false.

The first question is can the operation raise a system exception?

Like most operations in the spec. there is no mention of whether a system
exception can be raised. The C++ language mapping gives more information
but is still incomplete. I tried to intepret the spec. consistently,
i.e. if there is no explicit statement to the contrary, these operations
can raise a system exception. For instance, it is clearly stated in the C++
mapping that release() and is_nil() must not throw system exceptions, and
so they do not. Unfortunately, non_existent() is not covered by the current
mapping so it is up to each ORB to apply its own intepretation.

Suppose the operation is not allowed to raise a system exception, than
according to the spec. the ORB should return false in your case. This is
not very helpful. If what you want is ensure that the object exists before
you invoke on it, this is exactly the opposite behaviour you want. In
other words, the system exception is providing you with extra information
that cannot be conveyed through the return value of the operation. 

The ORB raises a COMM_FAILURE in this case because in the process of
executing the operation, the communication with a remote object cannot be 
established. In your case, because there is no process listening on the
socket.

Regards,

Sai-Lai



>>>>> Igor Cunko writes:

> I have trouble with CORBA::Object::_non_existent().I have primitive client
and
> server. This is basicaly procedure I use.

> Client call server->logIn(CORBA::Object_ptr obj)
> I put obj in array.
> Go trough array and invoke a[i]->_non_existent()
> Function exits.
> Client finish execution.
> Another time call to a[i]->_non_existent() raise COMM_FALIURE instead
return
> false. Is this correct behavior or failure in my logic.




------_=_NextPart_001_01C2663A.4308C620
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Diso-8859-1">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
5.5.2653.12">
<TITLE>CORBA::Object::_non_existent()??? - does not follow =
spec.</TITLE>
</HEAD>
<BODY>
<BR>

<P><FONT SIZE=3D2>Hi. Recently, I was switching from using micoORB to =
omniORB. And, I have encountered a problem with _non_existent. The =
behaviour is different for different ORBs.</FONT></P>

<P><FONT SIZE=3D2>MicoORB returns Boolean omniORB raises COMM_FAILURE =
exception.</FONT>
</P>

<P><FONT SIZE=3D2>While, I agree with Sai-Lai that an exception could =
provide you with more info. The problem is the _non_existent raises =
COMM_FAILURE exception when communication between client and server is =
lost as well as when only the object reference is stale. I think would =
be a better choice to use OBJECT_NOT_EXIST when object reference is =
invalid and TRANSIENT when the server cannot be reached. That would =
truly provide more info. and prevented the confusion. </FONT></P>

<P><FONT SIZE=3D2>&nbsp;&quot;Advanced CORBA...&quot; book by =
MH,SV&nbsp; provides description for both exceptions:</FONT>
<BR><FONT SIZE=3D2>OBJECT_NOT_EXIST</FONT>
<BR><FONT SIZE=3D2>&quot;This exception is an authoritative indication =
that the reference for the request is stale (denotes a non-existent =
object. ...&quot;</FONT></P>

<P><FONT SIZE=3D2>COMM_FAILURE</FONT>
<BR><FONT SIZE=3D2>&quot;This exception is raised if communication is =
lost while an operation is in progress. At the protocol level, the =
client sends a request to the server and then waits for a reply =
containing the results. If the connection drops after the client has =
sent the request but before the reply has arrived, the client-site =
...&quot;</FONT></P>

<P><FONT SIZE=3D2>&quot;Some ORBs incorrectly raise COMM_FAILURE =
instead of TRANSIENT if they cannot establish a connection to the =
server. If this is the case for your ORB, you should put pressure on =
the vendor to fix it.&quot;</FONT></P>

<P><FONT SIZE=3D2>Regards,</FONT>
<BR><FONT SIZE=3D2>Marzenna.</FONT>
</P>
<BR>

<P><FONT =
SIZE=3D2>---------------------------------------------------------------=
-------------</FONT>
<BR><FONT SIZE=3D2>Marzenna Kruczkowski - mkruczk@thestar.ca</FONT>
<BR><FONT SIZE=3D2>&nbsp;tel. 416 869-4606&nbsp; fax. 416 =
869-4804</FONT>
<BR><FONT SIZE=3D2>Corporate Information Technology </FONT>
<BR><FONT SIZE=3D2>Torstar Media Group</FONT>
</P>

<P><FONT SIZE=3D2>Hi. This is another grey area in the spec. that I =
have applied one of the</FONT>
<BR><FONT SIZE=3D2>several possible intepretations.</FONT>
</P>

<P><FONT SIZE=3D2>Accoring to CORBA 2 spec. sec. 7.2.5:</FONT>
</P>

<P><FONT SIZE=3D2>&gt; boolean non_existent();</FONT>
<BR><FONT SIZE=3D2>&gt; The non_existent operation may be used to test =
whether an object (e.g. a</FONT>
<BR><FONT SIZE=3D2>&gt; proxy object) has been destroyed. It does this =
without invoking any</FONT>
<BR><FONT SIZE=3D2>&gt; application level operation on the object, and =
so will never affect the</FONT>
<BR><FONT SIZE=3D2>&gt; object itself. It returns true (rather than =
raising</FONT>
<BR><FONT SIZE=3D2>&gt; CORBA::OBJECT_NOT_EXIST) if the ORB knows =
authoritatively that the</FONT>
<BR><FONT SIZE=3D2>&gt; object does not exist, and otherwise it returns =
false.</FONT>
</P>

<P><FONT SIZE=3D2>The first question is can the operation raise a =
system exception?</FONT>
</P>

<P><FONT SIZE=3D2>Like most operations in the spec. there is no mention =
of whether a system</FONT>
<BR><FONT SIZE=3D2>exception can be raised. The C++ language mapping =
gives more information</FONT>
<BR><FONT SIZE=3D2>but is still incomplete. I tried to intepret the =
spec. consistently,</FONT>
<BR><FONT SIZE=3D2>i.e. if there is no explicit statement to the =
contrary, these operations</FONT>
<BR><FONT SIZE=3D2>can raise a system exception. For instance, it is =
clearly stated in the C++</FONT>
<BR><FONT SIZE=3D2>mapping that release() and is_nil() must not throw =
system exceptions, and</FONT>
<BR><FONT SIZE=3D2>so they do not. Unfortunately, non_existent() is not =
covered by the current</FONT>
<BR><FONT SIZE=3D2>mapping so it is up to each ORB to apply its own =
intepretation.</FONT>
</P>

<P><FONT SIZE=3D2>Suppose the operation is not allowed to raise a =
system exception, than</FONT>
<BR><FONT SIZE=3D2>according to the spec. the ORB should return false =
in your case. This is</FONT>
<BR><FONT SIZE=3D2>not very helpful. If what you want is ensure that =
the object exists before</FONT>
<BR><FONT SIZE=3D2>you invoke on it, this is exactly the opposite =
behaviour you want. In</FONT>
<BR><FONT SIZE=3D2>other words, the system exception is providing you =
with extra information</FONT>
<BR><FONT SIZE=3D2>that cannot be conveyed through the return value of =
the operation. </FONT>
</P>

<P><FONT SIZE=3D2>The ORB raises a COMM_FAILURE in this case because in =
the process of</FONT>
<BR><FONT SIZE=3D2>executing the operation, the communication with a =
remote object cannot be </FONT>
<BR><FONT SIZE=3D2>established. In your case, because there is no =
process listening on the</FONT>
<BR><FONT SIZE=3D2>socket.</FONT>
</P>

<P><FONT SIZE=3D2>Regards,</FONT>
</P>

<P><FONT SIZE=3D2>Sai-Lai</FONT>
</P>
<BR>
<BR>

<P><FONT SIZE=3D2>&gt;&gt;&gt;&gt;&gt; Igor Cunko writes:</FONT>
</P>

<P><FONT SIZE=3D2>&gt; I have trouble with =
CORBA::Object::_non_existent().I have primitive client and</FONT>
<BR><FONT SIZE=3D2>&gt; server. This is basicaly procedure I =
use.</FONT>
</P>

<P><FONT SIZE=3D2>&gt; Client call server-&gt;logIn(CORBA::Object_ptr =
obj)</FONT>
<BR><FONT SIZE=3D2>&gt; I put obj in array.</FONT>
<BR><FONT SIZE=3D2>&gt; Go trough array and invoke =
a[i]-&gt;_non_existent()</FONT>
<BR><FONT SIZE=3D2>&gt; Function exits.</FONT>
<BR><FONT SIZE=3D2>&gt; Client finish execution.</FONT>
<BR><FONT SIZE=3D2>&gt; Another time call to a[i]-&gt;_non_existent() =
raise COMM_FALIURE instead return</FONT>
<BR><FONT SIZE=3D2>&gt; false. Is this correct behavior or failure in =
my logic.</FONT>
</P>
<BR>
<BR>

</BODY>
</HTML>
------_=_NextPart_001_01C2663A.4308C620--


--==_15385061517066==_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Get to know us
http://www.thestar.com - Canada's largest daily newspaper online
http://www.toronto.com - All you need to know about T.O.
http://www.workopolis.com - Canada's biggest job site
http://www.torontostartv.com - Webcasting & Production
http://www.newinhomes.com - Ontario's Largest New Home & Condo Website
http://www.waymoresports.com - Canada's most comprehensive sports site
http://www.tmgtv.ca - Torstar Media Group Television

--==_15385061517066==_--