Return-Path: X-Original-To: apmail-cayenne-dev-archive@www.apache.org Delivered-To: apmail-cayenne-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 218576C6B for ; Wed, 27 Jul 2011 20:53:33 +0000 (UTC) Received: (qmail 30626 invoked by uid 500); 27 Jul 2011 20:53:32 -0000 Delivered-To: apmail-cayenne-dev-archive@cayenne.apache.org Received: (qmail 30412 invoked by uid 500); 27 Jul 2011 20:53:32 -0000 Mailing-List: contact dev-help@cayenne.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cayenne.apache.org Delivered-To: mailing list dev@cayenne.apache.org Received: (qmail 30399 invoked by uid 99); 27 Jul 2011 20:53:32 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 27 Jul 2011 20:53:32 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [208.78.103.231] (HELO vorsha.objectstyle.org) (208.78.103.231) by apache.org (qpsmtpd/0.29) with SMTP; Wed, 27 Jul 2011 20:53:24 +0000 Received: (qmail 27271 invoked from network); 27 Jul 2011 20:53:03 -0000 Received: from unknown (HELO ?127.0.0.1?) (127.0.0.1) by localhost with SMTP; 27 Jul 2011 20:53:03 -0000 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Apple Message framework v1084) Subject: Re: [jira] [Commented] (CAY-1595) EHCache implementation of Provider From: Andrus Adamchik In-Reply-To: Date: Wed, 27 Jul 2011 23:53:02 +0300 Content-Transfer-Encoding: quoted-printable Message-Id: References: <1810791998.12337.1311781749589.JavaMail.tomcat@hel.zones.apache.org> To: dev@cayenne.apache.org X-Mailer: Apple Mail (2.1084) X-Virus-Checked: Checked by ClamAV on apache.org On Jul 27, 2011, at 11:16 PM, Andrus Adamchik wrote: > I think we can start with an implementation that quietly ignores = groups and uses a single cache (and hence a single expiration policy) = for all query entries. It is rather crippled, as it would preclude = targeted invalidation, but it will be a start. And then who knows, maybe = EHC-240 is committed. So here is an attempt of cache group design over EHCache...=20 First, a few assumptions: 1. if a query has multiple cache groups, we ignore all but the first = one. This is quite reasonable IMO. It will suffice for most scenarios. 2. We store keys for each cache group in a separate EHCache instance = within the same CacheManager.=20 3. For entries with no cache groups, we allocate a separate EHCache = instance. I think this will allow us to implement all methods of QueryCache = interface. However we may end up with duplicate cache entries if the = same query was run with different cache groups, which may potentially = increase memory use and introduce a new type of cache consistency = problems. So it is not as flexible as OSCache, but is much better than = no cache group support at all. As long as users are aware of it, we = should be fine. =20 Andrus