Return-Path: Delivered-To: apmail-cayenne-user-archive@www.apache.org Received: (qmail 97890 invoked from network); 13 May 2009 23:20:14 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 13 May 2009 23:20:14 -0000 Received: (qmail 40382 invoked by uid 500); 13 May 2009 23:20:13 -0000 Delivered-To: apmail-cayenne-user-archive@cayenne.apache.org Received: (qmail 40354 invoked by uid 500); 13 May 2009 23:20:13 -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 40344 invoked by uid 99); 13 May 2009 23:20:13 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 13 May 2009 23:20:13 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of ari@ish.com.au designates 59.167.240.32 as permitted sender) Received: from [59.167.240.32] (HELO fish.ish.com.au) (59.167.240.32) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 13 May 2009 23:20:01 +0000 Received: from [10.29.62.3] (port=49672) by fish.ish.com.au with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.69) (envelope-from ) id 1M4OdV-0000ad-1u for user@cayenne.apache.org; Thu, 14 May 2009 10:17:21 +1000 Message-Id: <10B0F35B-FE59-4F2B-979E-9671A8C59A1F@ish.com.au> From: Aristedes Maniatis To: user@cayenne.apache.org In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed; delsp=yes Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Apple Message framework v935.3) Subject: Re: 3.0 cache documentation Date: Thu, 14 May 2009 09:19:27 +1000 References: <86C2117E-94F8-4B8A-B6B3-DB51B0850C44@objectstyle.org> X-Mailer: Apple Mail (2.935.3) X-Virus-Checked: Checked by ClamAV on apache.org On 13/05/2009, at 11:28 PM, Borut Bol=C4=8Dina wrote: > Now a question. Let's say I create a select query on paintings with =20= > OSCache > cache group paintings. Lets say there are 3 paintings: p1, p2 and p3. > > Now they are cached in object cache and in separete query cache? Two =20= > cache > entries? Correct. Two different types of cache. > Let's say I create another painting and insert it into the db. The new > painting p4 is now in object cache. If I want to have fresh list of > paintings, I now have to invalidate the paintings cache group in the > onCommit callback function. If you way you fetch that list is through another query on the current =20= context, then yes, you need to invalidate the query cache. > Is there an alternative, like simply adding this > p4 to cache group paintings? You can't do that. But you can maintain your own List of paintings and =20= add the new one to that. Remember that Cayenne does no in-memory =20 evaluation of the query so it cannot know whether your new painting =20 belongs in the list of (say) paintings starting with "A". > If not, will the subsequent fetch contact the db for all p1-p4 or is =20= > there a > way that paintings will get fetched from object cache if they are =20 > there? I > want to avoid reading (tens of)thousands of rows because =20 > occasionally some > get inserted. =46rom Andrus' previous reply, the fresh query against the db will read = =20 in all the relevant objects and replace them in the object cache. So =20 effective the object cache is used for following relations, but not =20 when performing a fresh query against the db. Ari --------------------------> ish http://www.ish.com.au Level 1, 30 Wilson Street Newtown 2042 Australia phone +61 2 9550 5001 fax +61 2 9550 4001 GPG fingerprint CBFB 84B4 738D 4E87 5E5C 5EFA EF6A 7D2E 3E49 102A