donalmurtagh@[EMAIL PROTECTED]
wrote:
> Hi,
>
> I'm writing a java CORBA client, using the Visibroker ORB. Sometimes
> when I call methods on the remote object references I get the following
> exception
>
> org.omg.CORBA.OBJECT_NOT_EXIST: vmcid: OMG minor code: 0 completed:
> No
>
> Is there some way that I can check beforehand whether this exception
> will be thrown, i.e. whether the remote object still exists? I thought
> that I could do it like this:
>
> if (myRef._non_existent()) {
>
> // get a new myRef
> }
>
> myRef.doRemoteMethod();
>
>
> But I've found that _non_existent() throws exceptions. Is there a
> better way to check for the state that causes an OBJECT_NOT_EXIST
> exception?
We should say thanks to OMG that made this change in 2.3 (or earlier?).
Now, your best around is to be write a wrapper that catches exceptions
and return true.
For visibroker, I recall it has a property you can set that will force
the ORB to be backward compatible to CORBA 2.2, namely, non_existent()
returns true, instead of throwing a exception, when it fails to connect
to the server.
Regards,
Ke
>
> Regards,
> Dan


|