Return-Path: Delivered-To: apmail-db-jdo-dev-archive@www.apache.org Received: (qmail 85537 invoked from network); 24 Mar 2006 20:23:56 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 24 Mar 2006 20:23:56 -0000 Received: (qmail 99499 invoked by uid 500); 24 Mar 2006 20:23:55 -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 99488 invoked by uid 99); 24 Mar 2006 20:23:55 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 24 Mar 2006 12:23:55 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: local policy) Received: from [62.240.242.88] (HELO smtp.xcalia.com) (62.240.242.88) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 24 Mar 2006 12:23:54 -0800 Received: from localhost ([127.0.0.1]) by diane with esmtp (Exim 4.52) id 1FMsok-0002vt-DR; Fri, 24 Mar 2006 21:23:31 +0100 Received: from diane ([127.0.0.1]) by localhost (diane [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 10347-01; Fri, 24 Mar 2006 21:23:30 +0100 (CET) Received: from [172.16.0.30] (helo=DELLZILLA) by diane with esmtpa (Exim 4.52) id 1FMsoi-0002vF-E1; Fri, 24 Mar 2006 21:23:29 +0100 Reply-To: From: "Matthew T. Adams" To: , , Date: Fri, 24 Mar 2006 12:22:47 -0800 Organization: Xcalia Message-ID: <001d01c64f80$cd89dbd0$1e0010ac@DELLZILLA> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.6626 In-Reply-To: <20060324193843.D58AF10FB007@asf.osuosl.org> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670 Importance: Normal X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at xcalia.com X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: matthew.adams@xcalia.com Subject: RE: serialize Detachable instance for storage X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on diane X-Spam-Level: X-SA-Exim-Version: 4.2 (built Thu, 03 Mar 2005 10:44:12 +0100) X-SA-Exim-Scanned: Yes (on diane) X-Virus-Checked: Checked by ClamAV on apache.org X-Old-Spam-Status: No, score=-2.7 required=5.0 tests=ALL_TRUSTED,AWL autolearn=failed version=3.0.4 X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N I agree on all points, Andy. Craig, I would think it to be beneficial to explicitly state something about what compliant implementations should do when serializing instances for the purposes of embedded storage versus for any other reason. It is not currently discussed, although it does seem intutive for the JDO implementation to handle this situation correctly. --matthew >-----Original Message----- >From: Andy Jefferson [mailto:andy@jpox.org] >Sent: Friday, March 24, 2006 11:51 AM >To: jdo-dev@db.apache.org; jdo-experts-ext@sun.com >Subject: RE: serialize Detachable instance for storage > > >Hi, > >> I now understand your issue. If you declare a PC class that >is detachable >> to also be serialized in another class, how do you prevent >the detachment >> algorithm from running when the instance is being >serialized/deserialized >> for the purposes of persistent storage versus being >serialized/deserialized >> for any other reason? After all, the desired behavior, I >think, is to store >> embedded serialized instances as they are in their current >state, not in a >> detached-clean or detached-dirty state. > >Agreed. Storage in a datastore and retrieval from the >datastore should be >transparent to the user, and should not involve detachment. > >> // Q1: During storage, 'address' will be serialized, due to >metadata requirement >> and serialized objects are implicitly detached according to >spec section 12.6.8. >> Is the address stored in the database detached? > >I say no. > >> // Q2: Does 'address' reference a detached instance now because of >> serialization of Person.address? > >I say no. > >> Does that mean then, that an Address deserialized from the >data store is >> detached-clean or persistent-clean? > >persistent-clean. If the user updates a field on a serialised >PC object, whilst >within the txn, they would expect it to make it into the >datastore. If the object >is detached it has no StateManager and so any change will not >be persisted. > > >The implementation can easily detect when it is serialising an >object for storage >in the datastore (as opposed to any normal call to >StateManager.preSerialize()), >and JPOX CVS currently assumes that the storage of serialised >PC's does *not* >contain the detach state. > >PS. There are no TCK tests that check on this currently, as >noticed when we had >implemented it in a pure JDO2 spec way, detaching all >serialised objects. JPOX >does however have its own unit tests that do check this situation. > >-- >Andy >