persistence@glassfish.java.net

Re: Re1: fixing issue 634?

From: Tom Ware <tom.ware_at_oracle.com>
Date: Thu, 28 Sep 2006 15:04:46 -0400

Hi Marina,

  I am waiting for Ken's response about the question you posed in your
earlier email:

"When would such fix make it into GF? Best case? Worst case?"

-Tom

Marina Vatkina wrote:

>Tom,
>
>Any decision on this? ORB bug might not be fixed in 9.1 time frame.
>
>-marina
>
>Marina Vatkina wrote:
>
>
>>Tom,
>>
>>I added all that I could to the comments:
>>
>>diff -r1.3 EnumTypeConverter.java
>>107a108,136
>>
>>
>>
>>> /**
>>> * INTERNAL:
>>> * Convert Enum object to the data value.
>>> *
>>> * Because of the following ORB issue, the Enum object returned from a
>>> * client via unmarshalling, does not compare equals() to the instance
>>> * created in this VM. This results in a corresponding value not being
>>> * found, and in unexpected exception "No conversion value provided for
>>> * the attribute [XXXXX]".
>>> * The solution is to return the corresponding value from the Enum instance
>>> * directly.
>>> * Note, that this problem doesn't affect data to object conversion.
>>> *
>>> * The ORB issue: JDK 5 support for enum also required a small addition to
>>> * the Java serialization spec to accommodate enums. This requires a
>>> * corresponding change in the RMI-IIOP specification, which has a different
>>> * serialization format than Java serialization and standard RMI over JRMP
>>> * (not RMI-IIOP).
>>> */
>>> public Object convertObjectValueToDataValue(Object attributeValue, Session
>>>
>>>
>>session) {
>>
>>
>>
>>> if (attributeValue == null) {
>>> return super.convertObjectValueToDataValue(null, session);
>>> }
>>>
>>> Enum theEnum = Enum.class.cast(attributeValue);
>>> return (m_usesOrdinalValues)? theEnum.ordinal() : theEnum.name();
>>> }
>>>
>>>
>>>
>>Is it enough?
>>
>>thanks,
>>-marina
>>
>>Ken Cavanaugh wrote On 09/27/06 14:01,:
>>
>>
>>
>>>On Wed, 2006-09-27 at 13:05 -0700, Marina Vatkina wrote:
>>>
>>>
>>>
>>>
>>>>Hi Tom,
>>>>
>>>>Unfortunately, the ORB bug can't be fixed as per OMG spec it's the correct
>>>>behavior. This is what Ken Cavanaugh wrote in the 193 notes: "Can't fix
>>>>this for AS 9. May need a spec change at the OMG level."
>>>>
>>>>We had several user that needed ugly work arounds because of that problem.
>>>>
>>>>Ken, can you please comment on that? (Don't worry if you are not on the
>>>>alias - I'll accept your email).
>>>>
>>>>
>>>>
>>>The problem is that JDK 5 support for enum also required a small
>>>addition to the Java serialization
>>>spec to accommodate enums. This requires a corresponding change in the
>>>RMI-IIOP specification,
>>>which has a different serialization format than Java serialization and
>>>standard RMI over JRMP
>>>(not RMI-IIOP). There is now an issue at the OMG (issue 10336: see
>>>http://www.omg.org/issues/java2idl-rtf.open.html#Issue10336 ), but the
>>>Java to IDL RTF has not
>>>yet voted on this.
>>>
>>>I think a reasonable approach for us might be to implement the
>>>resolution to the issue as soon as
>>>it is finalized and voted in. I think this will have to wait until the
>>>JavaIDL RTF is re-chartered in
>>>Anaheim this week. Harold used to be the Sun rep on the RTF, but since
>>>he's moved on to
>>>WSIT, I'll be taking his place on the RTF.
>>>
>>>I've just sent an email to the RTF alias to see when we can get started
>>>on the issue. I'll also need to investigate
>>>the impact of this fix on interoperability with other ORBs (especially
>>>ours) that do not have the
>>>fix.
>>>
>>>Ken.
>>>
>>>

-- 
Tom Ware
Principal Software Engineer
Oracle Canada Inc.
Direct: (613) 783-4598
Email: tom.ware_at_oracle.com