Skip to main content

VBC 4.x: Why does _non_existent() method throw an exception?

  • February 16, 2013
  • 0 replies
  • 0 views

Problem:

  • Product Name: VisiBroker for C
  • Product Version: 4.5.x
  • Product Component: ORB
  • Platform/OS Version: All

Why does _non_existent() method throw an exception?

Resolution:

From CORBA 2.3 specification onwards, _non_existent() can result in a CORBA exception (this was not the case with VBC 3.x). Below is an extract from the specification for reference:

4.3.5 Probing for Object Non-Existence
4.3.5.1 non_existent 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; otherwise, it returns false.

Services that maintain state that includes object references, such as bridges, event channels, and base relationship services, might use this operation in their idle time to sift through object tables for objects that no longer exist, deleting them as they go, as a form of garbage collection. In the case of proxies, this kind of activity can cascade, such that cleaning up one table allows others then to be cleaned up.

Probing for object non-existence may require contacting the ORB that implements the target object. Such an attempt may fail at either the local or the remote end. If nonexistent cannot make a reliable determination of object existence due to failure, it raises an exception in the calling application code. This enables the application to distinguish among the true, false, and indeterminate cases. 

 

#Security
#VisiBroker