[omniORB] DynValueCommon and sharing semantics

Duncan Grisby duncan at grisby.org
Wed Aug 2 12:39:01 BST 2006


On Wednesday 26 July, JiangWei wrote:

> http://www.omg.org/issues/corba-rtf.open.html#Issue8986
> 
> How to work-around this issues with omniORB4?

I'm afraid I don't understand what that issue is trying to say. It seems
to be saying that the CORBA spec doesn't say values in Anys are shared.
The spec does quite clearly say that. Section 5.2.4.3 of the 2.6 spec
(which omniORB targets) says:

  When an instance of the value type is passed as a parameter to an
  operation of a non-local interface, the effect in all cases shall be
  as if an independent copy of the instance is instantiated in the
  receiving context. ... This applies to all valuetypes involved in the
  invocation, including those embedded in other IDL datatypes or in an
  any.

So it's quite clear that values inside Anys are shared, and omniORB
completely supports that.

The 2.6 spec does not mention anything about value sharing within
DynAny. The 3.0 spec does have some words about it, but I don't think it
makes any sense at all. It is far from complete in terms of actually
specifying the constraints, and the way I think it was meant to be
interpreted is in my opinion unimplementable.

What omniORB does is to convert an Any into a DynAny on demand, and at
that time, any sharing information is lost. Once the DynAny is converted
back into an Any, the value inside is once again a normal value, and can
be shared. Any other implementation would cause all kinds of problems, I
think.

Cheers,

Duncan.

-- 
 -- Duncan Grisby         --
  -- duncan at grisby.org     --
   -- http://www.grisby.org --



More information about the omniORB-list mailing list