db-jdo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marco Schulze <Ma...@NightLabs.de>
Subject JDOHelper.getVersion(Object): Behaviour of jdo versioning
Date Mon, 06 Nov 2006 22:17:48 GMT
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).
* 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

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:

May we kindly ask you to consider our use case and to clarify the
versioning behaviour in JDO 2.1 as described above?

Best regards, Marco :-)

- --
***   http://NoSoftwarePatents-Award.com   ***
Marco Schulze                   NightLabs GmbH
                                Rehlingstr. 6d
                                79100 Freiburg

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

  Marco Schulze <Marco@NightLabs.de>
  Niklas Schiffler <Nick@NightLabs.de>

  Amtsgericht Freiburg, HRB 6186
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org


View raw message