[JavaIDL] Releasing CORBA object references in Java ?



<previously posted on comp.lang.java.programmer, with no response yet>

Hi all,

I really wonder what's the use of org.omg.CORBA.Object._release() and
_duplicate().

I was thinking that reference counting was the job of GC.

In C++ the reference counting, via the usage or _var and _ptr and methods
release() and duplicate(), is without ambiguity (even if complex and error
prone). But here in Java, the introduction of _release() and _duplicate() is
very strange.

Another point for the discussion: as I am using the JDK ORB implementation,
the Java Doc says:

"
- Object _duplicate()

Returns a duplicate of this CORBA object reference. The server object
implementation is not involved in creating the duplicate, and the
implementation cannot distinguish whether the original object reference or a
duplicate was used to make a request.

Note that this method is not very useful in the Java platform, since
memory management is handled by the VM. It is included for compliance with
the CORBA APIs.

The method _duplicate may return this object reference itself.

- void _release()

Signals that the caller is done using this object reference, so internal
ORB resources associated with this object reference can be released. Note
that the object implementation is not involved in this operation, and other
references to the same object are not affected.
"

My opinion here is that releasing references or not won't make any
difference, and duplicating them is pointless.

But what does the standard says ?

Thanks in advance,

JC.


.



Relevant Pages

  • Re: pass by reference
    ... talking about Java, that it does when talking about other languages. ... this is also true for "reference" itself. ... Because one "reference" is an object reference, ... This is natural language as I understand it. ...
    (comp.lang.java.programmer)
  • Re: Cobol data protection? Get a dog...
    ... "Parameters specified in the USING phrase of a method Procedure Division ... some of you who are most knowledgable about the standards process. ... dereference a reference (back to the invokers WS or worse back up through the ... I am aware that you can pass an object reference to a method, ...
    (comp.lang.cobol)
  • Releasing object references in Java ?
    ... I was thinking that reference counting was the job of GC. ... But here in Java, the introduction of _releaseand _duplicate() is ... Returns a duplicate of this CORBA object reference. ...
    (comp.object.corba)
  • RE: reference to handle / handle to reference
    ... As far as I know, there's no conversion between an object reference and an Int32, unless you pin objects using GCHandles and get their associated IntPtrs. ...
    (microsoft.public.dotnet.general)
  • Re: Q: closing forms
    ... The only real difference between passing by reference and by value takes ... passing the object reference by reference ... If a Is Nothing Then MsgBox("After call using ByRef, ... Private Sub MyProcByReference ...
    (microsoft.public.dotnet.languages.vb)

Loading