cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Musall, Maik" <m...@selbstdenker.ag>
Subject Re: ObjectCache
Date Fri, 24 Feb 2017 10:00:23 GMT
Hi all,

I'd like to extend this question a bit. I just read the entire performance tuning chapter
again [1], and I'm a bit puzzled especially about the ObjectContext's local caches, which
Andrus also recommended to use in the "A way to refreshObject()" thread:

> So instead of micro-optimizations with shared snapshot cache, you should use queries
with cache groups and query cache. They get refetched when a cache group is flushed in response
to an object commit. So technically you are not reusing the snapshot cache, but it really
doesn't matter. The benefit you get in code simplicity, consistency, and often performance,
always outweighs that. Besides this approach is cluster-friendly.

Coming from EOF I grew the habit of frequently creating short-lived ObjectContexts, so basically
every page load uses it's own new ObjectContext to get fresh data from the shared global cache,
because other users may have altered data between page loads. While working on a page, I have
references to the objects that I need there anyway, so I don't understand at all what that
context-local cache mechanism should do for me, unless that "create new contexts all the time"
strategy is just plain wrong for Cayenne-based applications?

And even if I would use a longer-lived ObjectContext for something, where would that local
cache get in effect? Either I have references to objects anyway, or I would need to refetch
them, which would go through to the database, right? In what case would I get a benefit from
a local cache? I didn't find answers to this in the Cayenne Guide.

Thanks
Maik

[1] https://cayenne.apache.org/docs/4.0/cayenne-guide/performance-tuning.html <https://cayenne.apache.org/docs/4.0/cayenne-guide/performance-tuning.html>


> Am 23.02.2017 um 09:43 schrieb Markus Reich <markus.reich@markusreich.at>:
> 
> Hi,
> 
> I'm looking for a more detailed explaination of the caching mechanism, as
> we are running a quite important and big web application with cayenne, I
> want to fine tune, because we run in some performance issues.
> 
> I only found this
> https://cayenne.apache.org/docs/3.0/individual-object-caching.html
> 
> In 4.0 docu I can't find anything
> 
> br
> Meex


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message