Return-Path: Delivered-To: apmail-db-jdo-dev-archive@www.apache.org Received: (qmail 81835 invoked from network); 8 May 2007 01:05:14 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 8 May 2007 01:05:14 -0000 Received: (qmail 8671 invoked by uid 500); 8 May 2007 01:05:21 -0000 Mailing-List: contact jdo-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: jdo-dev@db.apache.org Delivered-To: mailing list jdo-dev@db.apache.org Received: (qmail 8660 invoked by uid 99); 8 May 2007 01:05:21 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 07 May 2007 18:05:20 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=UNPARSEABLE_RELAY X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: local policy) Received: from [192.18.42.249] (HELO nwk-ea-fw-1.sun.com) (192.18.42.249) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 07 May 2007 18:05:13 -0700 Received: from d1-sfbay-09.sun.com ([192.18.39.119]) by nwk-ea-fw-1.sun.com (8.13.6+Sun/8.12.9) with ESMTP id l4814r3U016015 for ; Mon, 7 May 2007 18:04:53 -0700 (PDT) Received: from conversion-daemon.d1-sfbay-09.sun.com by d1-sfbay-09.sun.com (Sun Java System Messaging Server 6.2-6.01 (built Apr 3 2006)) id <0JHP00A016VUBR00@d1-sfbay-09.sun.com> (original mail from Craig.Russell@Sun.COM) for jdo-dev@db.apache.org; Mon, 07 May 2007 18:04:53 -0700 (PDT) Received: from [192.168.0.11] (c-24-6-172-77.hsd1.ca.comcast.net [24.6.172.77]) by d1-sfbay-09.sun.com (Sun Java System Messaging Server 6.2-6.01 (built Apr 3 2006)) with ESMTPSA id <0JHP005HV704BP70@d1-sfbay-09.sun.com> for jdo-dev@db.apache.org; Mon, 07 May 2007 18:04:53 -0700 (PDT) Date: Mon, 07 May 2007 18:04:52 -0700 From: Craig L Russell Subject: Re: detachable vs non detachable classes serialization compatible In-reply-to: <1178584299.463fc4ebb6a6c@webmail.jpox.org> Sender: Craig.Russell@Sun.COM To: jdo-dev@db.apache.org Cc: JDO Expert Group Message-id: <361F8AFE-9BBD-402F-A759-93D357DB9628@SUN.com> MIME-version: 1.0 X-Mailer: Apple Mail (2.752.3) Content-type: multipart/signed; protocol="application/pkcs7-signature"; boundary=Apple-Mail-215-563113201; micalg=sha1 References: <1178455160.463dcc7805f46@webmail.jpox.org> <1178584299.463fc4ebb6a6c@webmail.jpox.org> X-Virus-Checked: Checked by ClamAV on apache.org --Apple-Mail-215-563113201 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=WINDOWS-1252; delsp=yes; format=flowed Hi Erik, These are implementation details. Can you explain what the user =20 behavior is, and the use case? Thanks, Craig On May 7, 2007, at 5:31 PM, Erik Bengtson wrote: > Craig, > > There are two cases: Classes using default Serialization and =20 > classes with User > Serialization Code. > > In all cases the User must add serialVersionId field to the non =20 > enhanced class. > > Default Serialization: > > The default serialization will take care of dropping the =20 > jdoDetachedState. The > enhancer adds the following: > > private writeObject (OutputStream os) //enhanced > { > jdoPreSerialize(); > os.defaultWriteObject() > } > > User Serialization (user defined writeObject and readObject methods): > > private writeObject (OutputStream os) > { > jdoPreSerialize(); //enhanced > //user serialization > os.writeObject(jdoDetachedState) //enhanced > } > > private readObject (OutputStream os) > { > //user serialization > jdoDetachedState =3D os.readObject(); //enhanced > } > > > > Quoting Craig L Russell : > >> Hi Erik, >> >> It would help if you could explain what you have in mind with this >> change. The decision to make the detachable serialization contract >> incompatible was deliberate, and the objective is to guarantee that >> attaching a detached instance behaves correctly. >> >> If you want a detached instance simply to send it away and never >> expect to see it again, your proposal might be of interest. Is that >> what you had in mind? >> >> Do you have some ideas on how to implement this feature? Seems that >> if the unenhanced class is given an input stream with the detached >> info in the serialized form of the instance, it's going to run into >> an exception (unless you modify the unenhanced class, perhaps with a >> byte-code enhancer). >> >> Thanks, >> >> Craig >> >> On May 6, 2007, at 5:39 AM, Erik Bengtson wrote: >> >>> Hi, >>> >>> The spec says classes that detachable and non detachable classes >>> are not >>> compatible intentionally. I would like to propose a change to this >>> behavior and >>> let the =93jdoDetachedState=94 lose on unmarshalling. >>> >>> From: >>> "Classes marked as Detachable are not serialization-compatible with >>> un-enhanced >>> classes. This is intentional, and requires that the enhanced >>> version of the >>> class be used wherever the instance might be instantiated." >>> >>> To: >>> "Classes marked as Detachable are not serialization-compatible with >>> un-enhanced >>> classes. When unmarshalling a detached object with an un-enhanced >>> version of >>> the class, the detached state is dropped and no further read or >>> change tracking >>> will occur on the unmarshalled instance." >>> >>> Regards, >>> >>> Erik Bengtson >> >> Craig Russell >> Architect, Sun Java Enterprise System http://java.sun.com/products/=20= >> jdo >> 408 276-5638 mailto:Craig.Russell@sun.com >> P.S. A good JDO? O, Gasp! >> >> > > > Craig Russell Architect, Sun Java Enterprise System http://java.sun.com/products/jdo 408 276-5638 mailto:Craig.Russell@sun.com P.S. A good JDO? O, Gasp! --Apple-Mail-215-563113201 Content-Transfer-Encoding: base64 Content-Type: application/pkcs7-signature; name=smime.p7s Content-Disposition: attachment; filename=smime.p7s MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIGUDCCAwkw ggJyoAMCAQICECpJVMO68ii+Xfsc1O1YYFIwDQYJKoZIhvcNAQEFBQAwYjELMAkGA1UEBhMCWkEx JTAjBgNVBAoTHFRoYXd0ZSBDb25zdWx0aW5nIChQdHkpIEx0ZC4xLDAqBgNVBAMTI1RoYXd0ZSBQ ZXJzb25hbCBGcmVlbWFpbCBJc3N1aW5nIENBMB4XDTA2MTIwOTE5NTEwNVoXDTA3MTIwOTE5NTEw NVowbDEQMA4GA1UEBBMHUnVzc2VsbDEUMBIGA1UEKhMLQ3JhaWcgTGFpcmQxHDAaBgNVBAMTE0Ny YWlnIExhaXJkIFJ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