cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrus Adamchik <and...@objectstyle.org>
Subject Re: SnapshotVersion
Date Wed, 08 Mar 2017 19:24:37 GMT
Hi Markus,

Snapshot version reflects the version of a cached snapshot that was used to sync the current
state of the object (this is probably obvious). The behavior observed by you may actually
be a bug (and we may need to investigate it). 

Generally I would recommend against relying too much on snapshot version API. I always considered
it an implementation detail (though of course it is publicly accessible... oh well) that may
easily fall victim of a future DataObject redesign (e.g. see the parallel 'Fetching lots of
objects' thread). 

Can you explain how your cache is intended to work? Perhaps there is a callback/listener solution
to it?

Andrus

> On Mar 6, 2017, at 5:04 PM, Markus Reich <markus.reich@markusreich.at> wrote:
> 
> Hi,
> 
> I always thought that when the content of an object changes (by commit) the
> version gets incremented. I analyzed this a bit further and found sthg.
> which is very clear for me :-/
> 
> When I have two DataObjects with the same key/id and I change a value in
> one Object, I got a higher version after committing the changes. The other
> DataObjects also "gets" the new value, but the snapshot version stays the
> same?
> 
> The background is that I try to build a cache on computed values of
> DataObjects, so I need an indicator for invalidating my cache, I thought
> snapshot version would be perfect :-) but so it seems that this won't work
> for my idea :-/
> 
> best regards
> Meex


Mime
View raw message