Return-Path: Delivered-To: apmail-db-jdo-dev-archive@www.apache.org Received: (qmail 5967 invoked from network); 7 Nov 2006 19:35:09 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 7 Nov 2006 19:35:09 -0000 Received: (qmail 10005 invoked by uid 500); 7 Nov 2006 19:35:20 -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 9994 invoked by uid 99); 7 Nov 2006 19:35:20 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Nov 2006 11:35:20 -0800 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; Tue, 07 Nov 2006 11:35:05 -0800 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 kA7JYb9u007263 for ; Tue, 7 Nov 2006 11:34:41 -0800 (PST) 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 <0J8D00L01L10MY00@d1-sfbay-09.sun.com> (original mail from Craig.Russell@Sun.COM) for jdo-dev@db.apache.org; Tue, 07 Nov 2006 11:34:37 -0800 (PST) Received: from [129.145.133.119] by d1-sfbay-09.sun.com (Sun Java System Messaging Server 6.2-6.01 (built Apr 3 2006)) with ESMTPSA id <0J8D00DOVL1O3H90@d1-sfbay-09.sun.com> for jdo-dev@db.apache.org; Tue, 07 Nov 2006 11:34:36 -0800 (PST) Date: Tue, 07 Nov 2006 11:34:33 -0800 From: Craig L Russell Subject: Re: JDOHelper.getVersion(Object): Behaviour of jdo versioning In-reply-to: <454FB48C.6090707@NightLabs.de> Sender: Craig.Russell@Sun.COM To: Apache JDO project , JDO Expert Group Message-id: MIME-version: 1.0 X-Mailer: Apple Mail (2.752.2) Content-type: multipart/signed; protocol="application/pkcs7-signature"; boundary=Apple-Mail-101--62719871; micalg=sha1 References: <454FB48C.6090707@NightLabs.de> X-Virus-Checked: Checked by ClamAV on apache.org --Apple-Mail-101--62719871 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=ISO-8859-1; delsp=yes; format=flowed Hi Marco, I agree that the behavior of getVersion is not completely specified =20 by JDO in the current specification. I'll be happy to add more detail if there is consensus among the =20 experts. more below... On Nov 6, 2006, at 2:17 PM, Marco Schulze wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hello *, > > lately I recognized that JDOHelper.getVersion(Object) returned null in > StoreLifecycleListener.postStore(...). Therefore, I created a JPOX > issue: http://www.jpox.org/servlet/jira/browse/CORE-2993 > > Andy recommended to post here. > > Well, I read the paragraphs in the JDO spec about versioning and it > isn't completely clear to me how it should behave according to the > spec. It seems, currently, the version of an object is > created/incremented only at the end of a transaction. In my opinion, > it would make more sense to create/increment the version as early as > it's clear that the object will be different after commit: > > * In PersistenceManager.makePersistent(...) when a new object is > persisted or a detached object attached (hence the > StoreLifecycleListener.postStore(...) could already > access the correct version). This makes sense to me. > * Whenever a living object (which is currently attached to a > datastore) is modified for the first time within a transaction. > There's no need to modify the version multiple times within one > transaction. This makes sense. I don't know of a case where you would want to =20 change the version number more than once. > > For our use case it would be extremely useful, if the behaviour was > like this, because we would like to use the versioning for our > client-side caching system. It currently works like this: The server > registers all relevant JDO LifecycleListeners. Every listener collects > all Dirty/Attach/Store events that happen within one transaction. When > the transaction is committed, the collected events are sent to the > remote clients. Currently, the listeners get the old version (and not > the one, which the objects will have after commit). This prevents us > from optimizing our cache system. > > More info about our use case can be found here: > https://www.jfire.org/modules/phpwiki/index.php/HowToClientSideCache > > May we kindly ask you to consider our use case and to clarify the > versioning behaviour in JDO 2.1 as described above? I've replied including the JDO expert group for their comments. Regards, Craig > > Best regards, Marco :-) > > - -- > ______________________________________________ > *** http://NoSoftwarePatents-Award.com *** > ______________________________________________ > Marco Schulze NightLabs GmbH > Rehlingstr. 6d > 79100 Freiburg > Germany > > eMail: Marco@NightLabs.de > Fon: +49-761-2 111 793 > VoIP: sip:nlmarco@ekiga.net > Mobile: +49-172-212 63 80 > Fax: +49-761-2 111 798 > WWW: http://www.NightLabs.de > > Gesch=E4ftsf=FChrung: > Marco Schulze > Niklas Schiffler > > Eintragung: > Amtsgericht Freiburg, HRB 6186 > ______________________________________________ > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.2 (GNU/Linux) > Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org > > iD8DBQFFT7SLOn48nLzkjcIRAiuGAJ9+UNdNvqbd12Jo5tbs1L/TSosMcACeNLe5 > ous/B/J4NGUzhzh+ise4CxA=3D > =3DpCnK > -----END PGP SIGNATURE----- > 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-101--62719871 Content-Transfer-Encoding: base64 Content-Type: application/pkcs7-signature; name=smime.p7s Content-Disposition: attachment; filename=smime.p7s MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIGUDCCAwkw ggJyoAMCAQICEB7Y7fLHmKoeHTUdbtYrvpAwDQYJKoZIhvcNAQEEBQAwYjELMAkGA1UEBhMCWkEx JTAjBgNVBAoTHFRoYXd0ZSBDb25zdWx0aW5nIChQdHkpIEx0ZC4xLDAqBgNVBAMTI1RoYXd0ZSBQ ZXJzb25hbCBGcmVlbWFpbCBJc3N1aW5nIENBMB4XDTA1MTIxNTIxNDc0NFoXDTA2MTIxNTIxNDc0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