[Enterprise Extensions only]

Managing CORBA object references

The mapping for interface I defines a static member function named _duplicate that takes as input an object reference of type I_ptr and returns an object reference of type I_ptr (potentially the same reference, when reference counting is employed, as is the case with WebSphere Application Server C++ bindings). The CORBA::release function indicates that the caller will no longer access the object reference, and the resources associated with the object reference can be deallocated. (In the WebSphere Application Server C++ bindings, an object reference is only deleted when its reference count falls to zero, that occurs only if CORBA::release is called for each _duplicate or _narrow performed on the object reference.)

Duplicating an object reference using _duplicate is analogous to copying a string before transferring ownership of it, and releasing an object reference is analogous to deleting a string that is no longer needed. Unlike strings, object references cannot be directly copied or deleted by the client programmer; object references are managed by the ORB and can only be duplicated or released by the application.