Releasing object references in Java ?



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 ompoementation,
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: Repeating data input, Access 2003
    ... This reference is natively there in all versions of Access except 2000 and 2002. ... The article explains how to set up your form so that the boxes fill with the ... Unlike the Duplicate Record wizard, ... This one works by setting the Default Value of the controls, ...
    (microsoft.public.access.tablesdbdesign)
  • Re: current event and data sheet form and Dcount
    ... If you just want a warning message to advise a duplicate value would be ... needs you to reference the DAO object library in order to ... On my computer it is Microsoft DAO 3.6 ... > when user scroll the record in data sheet form and move from record to ...
    (microsoft.public.access.formscoding)
  • Re: Problem with code to catch duplicate Primay Key
    ... DAO lib reference is ... and no filters are applied to the underlying table. ... existing record - am entering duplicate HICN into the second record to test ...
    (microsoft.public.access.formscoding)
  • [JavaIDL] Releasing CORBA 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.lang.java.programmer)