[JavaIDL] Releasing CORBA object references in Java ?

J

Jesse

<previously posted on comp.object.corba, 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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top