cayenne-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrus Adamchik <>
Subject Re: Non-blocking DataRowStore - need help to test
Date Thu, 23 Feb 2012 06:10:18 GMT

On Feb 23, 2012, at 4:10 AM, Aristedes Maniatis wrote:

> * ConcurrentLinkedHashMap seems to have a roadmap
and ongoing development. Since this is the case, is it wise to fork it into the Cayenne source
rather than link to the built artifacts and make it easier to update in the future?

There are a few considerations. First, my general aversion to expanding the list of dependencies.
Aside from that ConcurrentLinkedHashMap is written for Java 1.6. We are supporting 1.5, so
I had to transform the original source to conform. So the plan is to merge changes made on
the ConcurrentLinkedHashMap side if we need them. 

> * How does this new code interact and relate to third party caches such as OScache when
used in Cayenne? I was never 100% clear about how the old one interacted, and I guess nothing
much had changed in this regard, but it would be good to understand this better.

This is snapshot cache. It does not interact with query caches at all at this point. But see

> * I see that version 2.0 will allow for pluggable eviction policies (They will switch
between LRU and LIRS). And they mention the idea of weighting by key/value. Any thoughts about
whether that would be useful to Cayenne to be able to implement even more flexible policies,
particularly given the demise of OScache?

A unified (objects, snapshots, query results) caching solution is a #1 feature for Cayenne
3.2 on my list. Once we start looking at that, it may turn out that ConcurrentLinkedHashMap
is only a stopgap measure until we can load snapshots into a unified cache. 

In any event it is useful to start playing with it now, as there's another synchronization
aspect of the DataRowStore that is provider-agnostic - per-commit snapshots processing used
to be done atomically with DataRowStore locked. Now each snapshot is processed independently,
so in a multithread environment the order of snapshot processing can get mixed up. My assertion
is that it doesn't matter, but I'd like to prove that somehow.


View raw message