Issue 5330: Stream encoding for omitted optional custom data (java2idl-rtf) Source: (Mr. Simon C. Nash, ) Nature: Uncategorized Issue Severity: Summary: The resolution for issue 3151 does not make it clear how to encode a custom valuetype that has no optional custom data. This includes custom types whose writeObject() method calls defaultWriteObject() but writes no additional data, and custom types that don't write any data at all. Tihs case could be handled by always writing the org.omg.customRMI.* wrapper even if there is no data inside of it. However, this is very wasteful of space. A better approach would be to write a null valuetype (0x00000000) to indicate the omission of the optional data. The optional data cannot be omitted entirely, since the receiver would not be able to correctly parse the stream. Proposed resolution: Change paragraph "d" in section 1.4.10 from the following: d. (optional) Additional data written by writeObject, encoded as specified below. For format version 1, the data is written "as is". For format version 2, the data is enclosed within a CDR custom valuetype with no codebase and repid "RMI:org.omg.custom.<class>" where <class> is the fully-qualified name of the class whose writeObject method is being invoked. to the following: d. Additional data written by writeObject, encoded as specified below. For format version 1, this data is optional and if present must be written "as is". For format version 2, if optional data is present then it must be enclosed within a CDR custom valuetype with no codebase and repid "RMI:org.omg.custom.<class>" where <class> is the fully-qualified name of the class whose writeObject method is being invoked. For format version 2, if optional data is not present then a null valuetype (0x00000000) must be written to indicate the absence of optional data. Resolution: Closed, accepted. See proposed revised text below Revised Text: 1. Change paragraph "d" in section 1.4.10 from the following: d. (optional) Additional data written by writeObject, encoded as specified below. For format version 1, the data is written "as is". For format version 2, the data is enclosed within a CDR custom valuetype with no codebase and repid "RMI:org.omg.custom.<class>" where <class> is the fully-qualified name of the class whose writeObject method is being invoked. to the following: d. Additional data written by writeObject, encoded as specified below. For format version 1, this data is optional and if present must be written "as is". For format version 2, if optional data is present then it must be enclosed within a CDR custom valuetype with no codebase and repid "RMI:org.omg.custom.<class>" where <class> is the fully-qualified name of the class whose writeObject method is being invoked. For format version 2, if optional data is not present then a null valuetype (0x00000000) must be written to indicate the absence of optional data. 2. At the end of the Value Unmarshaling section (1.5.1.5), add the following: "When using stream version 2, the ORB input stream must throw a MARSHAL exception with minor code [nn] to signal an incompatibility between the custom data on the wire and read operations from the ValueHandler until end_value is called. This can occur when a sender's version of a class does not write custom data, but the receiver's version attempts to perform a read operation." Actions taken: May 29, 2002: received issue December 11, 2002: closed issue Discussion: End of Annotations:===== Date: Tue, 28 May 2002 23:14:22 +0100 From: Simon Nash Organization: IBM X-Mailer: Mozilla 4.72 [en] (Windows NT 5.0; I) X-Accept-Language: en To: issues@omg.org CC: java2idl-rtf@omg.org Subject: Strem encoding for omitted optional custom data The resolution for issue 3151 does not make it clear how to encode a custom valuetype that has no optional custom data. This includes custom types whose writeObject() method calls defaultWriteObject() but writes no additional data, and custom types that don't write any data at all. Tihs case could be handled by always writing the org.omg.customRMI.* wrapper even if there is no data inside of it. However, this is very wasteful of space. A better approach would be to write a null valuetype (0x00000000) to indicate the omission of the optional data. The optional data cannot be omitted entirely, since the receiver would not be able to correctly parse the stream. Proposed resolution: Change paragraph "d" in section 1.4.10 from the following: d. (optional) Additional data written by writeObject, encoded as specified below. For format version 1, the data is written "as is". For format version 2, the data is enclosed within a CDR custom valuetype with no codebase and repid "RMI:org.omg.custom." where is the fully-qualified name of the class whose writeObject method is being invoked. to the following: d. Additional data written by writeObject, encoded as specified below. For format version 1, this data is optional and if present must be written "as is". For format version 2, if optional data is present then it must be enclosed within a CDR custom valuetype with no codebase and repid "RMI:org.omg.custom." where is the fully-qualified name of the class whose writeObject method is being invoked. For format version 2, if optional data is not present then a null valuetype (0x00000000) must be written to indicate the absence of optional data. Simon -- Simon C Nash, Chief Technical Officer, IBM Java Technology Tel. +44-1962-815156 Fax +44-1962-818999 Hursley, England Internet: nash@hursley.ibm.com Lotus Notes: Simon Nash@ibmgb From: "Everett Anderson" To: "Simon Nash" , Cc: Subject: RE: Strem encoding for omitted optional custom data Date: Tue, 28 May 2002 15:37:19 -0700 X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) Importance: Normal Hi, > The resolution for issue 3151 does not make it clear how to > encode a custom > valuetype that has no optional custom data. This includes > custom types > whose writeObject() method calls defaultWriteObject() but > writes no additional > data, and custom types that don't write any data at all. > > Tihs case could be handled by always writing the > org.omg.customRMI.* wrapper > even if there is no data inside of it. However, this is > very wasteful of > space. A better approach would be to write a null > valuetype (0x00000000) to > indicate the omission of the optional data. The optional > data cannot be omitted > entirely, since the receiver would not be able to correctly > parse the stream. I agree this is a problem, and like the proposed resolution. I'd really like to see this get into the interim report and wrapped up so we can get it into our next major release. Otherwise, it may leave interoperability issues open for stream version 2. - Everett > Proposed resolution: > > Change paragraph "d" in section 1.4.10 from the following: > > d. (optional) Additional data written by writeObject, > encoded as specified below. > For format version 1, the data is written "as is". For > format version 2, the > data is enclosed within a CDR custom valuetype with no > codebase and repid > "RMI:org.omg.custom." where is the > fully-qualified name of the > class whose writeObject method is being invoked. > > to the following: > > d. Additional data written by writeObject, encoded as > specified below. For format > version 1, this data is optional and if present must be > written "as is". For > format version 2, if optional data is present then it > must be enclosed within a > CDR custom valuetype with no codebase and repid > "RMI:org.omg.custom." > where is the fully-qualified name of the class > whose writeObject method > is being invoked. For format version 2, if optional > data is not present then a > null valuetype (0x00000000) must be written to indicate > the absence of optional data. > > Simon > -- > Simon C Nash, Chief Technical Officer, IBM Java Technology > Tel. +44-1962-815156 Fax +44-1962-818999 Hursley, England > Internet: nash@hursley.ibm.com Lotus Notes: Simon Nash@ibmgb > > Date: Wed, 29 May 2002 22:42:35 +0100 From: Simon Nash Organization: IBM X-Mailer: Mozilla 4.72 [en] (Windows NT 5.0; I) X-Accept-Language: en To: Jishnu Mukerji , Harold Carr , Jeffrey Mischkinsky , Yoshitaka Honishi , Andy Piper , Xudong Chen CC: java2idl-rtf@omg.org Subject: Re: issue 5330 -- Java to IDL RTF issue RTF members, In view of the need for a speedy resolution of this issue expressed by Everett, I would like to resolve it in time for the interim report. I plan to send out a vote on Friday May 31 unless anyone objects to the resolution proposed in the issue (appended below). Please review this proposal and let me know if you have any comments, questions, objections, or suggested alternatives. Simon Juergen Boldt wrote: > > This is issue # 5330 Simon Nash > Stream encoding for omitted optional custom data > > The resolution for issue 3151 does not make it clear how to encode a custom > valuetype that has no optional custom data. This includes custom types > whose writeObject() method calls defaultWriteObject() but writes no additional > data, and custom types that don't write any data at all. > > Tihs case could be handled by always writing the org.omg.customRMI.* wrapper > even if there is no data inside of it. However, this is very wasteful of > space. A better approach would be to write a null valuetype (0x00000000) to > indicate the omission of the optional data. The optional data cannot be > omitted > entirely, since the receiver would not be able to correctly parse the stream. > > Proposed resolution: > > Change paragraph "d" in section 1.4.10 from the following: > > d. (optional) Additional data written by writeObject, encoded as specified > below. For format version 1, the data is written "as is". For format > version 2, the data is enclosed within a CDR custom valuetype with no > codebase and repid "RMI:org.omg.custom." where is the > fully-qualified name of the class whose writeObject method is being > invoked. > > to the following: > > d. Additional data written by writeObject, encoded as specified below. > For format version 1, this data is optional and if present must be > written "as is". For format version 2, if optional data is present > then it must be enclosed within a CDR custom valuetype with no codebase > and repid "RMI:org.omg.custom." where is the fully- > qualified name of the class whose writeObject method is being invoked. > For format version 2, if optional data is not present then a null > valuetype (0x00000000) must be written to indicate the absence of > optional data. -- Simon C Nash, Chief Technical Officer, IBM Java Technology Tel. +44-1962-815156 Fax +44-1962-818999 Hursley, England Internet: nash@hursley.ibm.com Lotus Notes: Simon Nash@ibmgb From: "Everett Anderson" To: "Simon Nash" , Cc: Subject: RE: Strem encoding for omitted optional custom data Date: Tue, 4 Jun 2002 15:42:21 -0700 X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) Importance: Normal Hi Simon, I think you'll need to modify the resolution slightly so the ORB stream can communicate with the ValueHandler to let it know when there isn't any optional data. One way to do this, rather than modify the APIs, is for the ORB stream to go into a state in which it throws a MARSHAL exception with a standard minor code when read methods are called until the ValueHandler calls end_value. I propose that at the end of the Value Unmarshaling section (1.5.1.5) we add the following: "When using stream version 2, the ORB input stream must throw a MARSHAL exception with minor code [nn] to signal an incompatibility between the custom data on the wire and read operations from the ValueHandler until end_value is called. This can occur when a sender's version of a class does not write custom data, but the receiver's version attempts to perform a read operation." (This type of optional reading as part of class evolution is allowed in Java RMI.) - Everett > -----Original Message----- > From: Simon Nash [mailto:nash@hursley.ibm.com] > Sent: Tuesday, May 28, 2002 3:14 PM > To: issues@omg.org > Cc: java2idl-rtf@omg.org > Subject: Strem encoding for omitted optional custom data > > > The resolution for issue 3151 does not make it clear how to > encode a custom > valuetype that has no optional custom data. This includes > custom types > whose writeObject() method calls defaultWriteObject() but > writes no additional > data, and custom types that don't write any data at all. > > Tihs case could be handled by always writing the > org.omg.customRMI.* wrapper > even if there is no data inside of it. However, this is > very wasteful of > space. A better approach would be to write a null > valuetype (0x00000000) to > indicate the omission of the optional data. The optional > data cannot be omitted > entirely, since the receiver would not be able to correctly > parse the stream. > > Proposed resolution: > > Change paragraph "d" in section 1.4.10 from the following: > > d. (optional) Additional data written by writeObject, > encoded as specified below. > For format version 1, the data is written "as is". For > format version 2, the > data is enclosed within a CDR custom valuetype with no > codebase and repid > "RMI:org.omg.custom." where is the > fully-qualified name of the > class whose writeObject method is being invoked. > > to the following: > > d. Additional data written by writeObject, encoded as > specified below. For format > version 1, this data is optional and if present must be > written "as is". For > format version 2, if optional data is present then it > must be enclosed within a > CDR custom valuetype with no codebase and repid > "RMI:org.omg.custom." > where is the fully-qualified name of the class > whose writeObject method > is being invoked. For format version 2, if optional > data is not present then a > null valuetype (0x00000000) must be written to indicate > the absence of optional data. > > Simon > -- > Simon C Nash, Chief Technical Officer, IBM Java Technology > Tel. +44-1962-815156 Fax +44-1962-818999 Hursley, England > Internet: nash@hursley.ibm.com Lotus Notes: Simon Nash@ibmgb > >