Return-Path: Delivered-To: apmail-cayenne-user-archive@www.apache.org Received: (qmail 3786 invoked from network); 28 May 2010 06:39:46 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 28 May 2010 06:39:46 -0000 Received: (qmail 20323 invoked by uid 500); 28 May 2010 06:39:46 -0000 Delivered-To: apmail-cayenne-user-archive@cayenne.apache.org Received: (qmail 20318 invoked by uid 500); 28 May 2010 06:39:44 -0000 Mailing-List: contact user-help@cayenne.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cayenne.apache.org Delivered-To: mailing list user@cayenne.apache.org Received: (qmail 20307 invoked by uid 99); 28 May 2010 06:39:43 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 28 May 2010 06:39:43 +0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of garyjarrel@gmail.com designates 74.125.83.43 as permitted sender) Received: from [74.125.83.43] (HELO mail-gw0-f43.google.com) (74.125.83.43) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 28 May 2010 06:39:37 +0000 Received: by gwb11 with SMTP id 11so675744gwb.16 for ; Thu, 27 May 2010 23:39:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type; bh=BVPvIk8pYlAy9DWyIQ9nCyKaYXoZnfHObIChIcwy2y4=; b=UdBAeULbkidJBlB45hMmkGEeKfSHg8/NMCMXG04P5my9HvBwh0FJo/QGXnD/A0WwsG 2xMiABKc0jf4RVVlOkPMYyEaW7IcSdNQlvmTW2B+AA9eUKdxGVV4au51HwuX/R14KaEB C8inX3A/GS+8jEpO1YMqaCc8tmFH1EU6Elync= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=P0M0SpgfMxL5xFhhxd65Y0zyVY6Ibj2VDvl55fCoYM7dBGIq2ZElBYPivD1hcPOL3b +E1IIrO8ZHNTOEgcWjfYqUKN3O1U6g+QcS+ZimfcV0ZIXf0vKu/jPB0Snnq0TC6Q+gWo NyK8/SltuNRqyWKiE0C/W/9vD2k3gsRgqQV8I= MIME-Version: 1.0 Received: by 10.231.187.2 with SMTP id cu2mr1720715ibb.63.1275028755958; Thu, 27 May 2010 23:39:15 -0700 (PDT) Received: by 10.231.195.143 with HTTP; Thu, 27 May 2010 23:39:15 -0700 (PDT) In-Reply-To: <92583F17-2CBA-45B5-9C5A-5F4FE81F9255@objectstyle.org> References: <92583F17-2CBA-45B5-9C5A-5F4FE81F9255@objectstyle.org> Date: Fri, 28 May 2010 16:39:15 +1000 Message-ID: Subject: Re: More on caching From: Gary Jarrel To: user@cayenne.apache.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Checked: Checked by ClamAV on apache.org On Fri, May 28, 2010 at 4:28 PM, Andrus Adamchik wrote: > > On May 28, 2010, at 9:20 AM, Gary Jarrel wrote: > >> I would expect that the the second query q2 would not execute any SQL >> however the QueryLogger logs the second select statement. > > The second query has no cache group or cache strategy in your example, so it > is not using caching. Ahh I didn't realize that I had to specify the cache group for the second query as well... I thought given that I was executing a query with the same parameters it would have picked up the fact that one is already cached without having to specify which cache group to look into. Probably how I read the docs. So does this mean that for query caching to work I have to specify the cache group and cache strategy and that the modeler settings only apply to Object cache? > >> Also the assert on the query cache size fails the it appears the size >> is zero rather than 1 as I would have expected. > > is domain.getQueryCache().size() also returning zero? > No it seems that domain.getQueryCache().size() is returning 1 assertEquals(1, ((DataContext) getDataContext()).getParentDataDomain().getQueryCache().size()); assertEquals(1, ((DataContext) getDataContext()).getQueryCache().size()); I've put these 2 lines into the test case and it fails on the second line. Gary