Return-Path: Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: (qmail 71696 invoked from network); 21 Oct 2008 13:58:35 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 21 Oct 2008 13:58:35 -0000 Received: (qmail 81471 invoked by uid 500); 21 Oct 2008 13:58:38 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 81314 invoked by uid 500); 21 Oct 2008 13:58:37 -0000 Mailing-List: contact dev-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@openjpa.apache.org Delivered-To: mailing list dev@openjpa.apache.org Received: (qmail 81303 invoked by uid 99); 21 Oct 2008 13:58:37 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Oct 2008 06:58:37 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Oct 2008 13:57:35 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 66A91234C21E for ; Tue, 21 Oct 2008 06:57:44 -0700 (PDT) Message-ID: <1417445028.1224597464405.JavaMail.jira@brutus> Date: Tue, 21 Oct 2008 06:57:44 -0700 (PDT) From: "Kevin Sutter (JIRA)" To: dev@openjpa.apache.org Subject: [jira] Commented: (OPENJPA-738) QueryCache Improvement In-Reply-To: <555570833.1223335244193.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/OPENJPA-738?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12641383#action_12641383 ] Kevin Sutter commented on OPENJPA-738: -------------------------------------- I had some earlier concerns with the patch that I had communicated to Sandhya privately. So, I'm not sure if this patch was ready to be committed. I will touch base with Sandhya later today and find out the current status of this Issue. Thanks. > QueryCache Improvement > ---------------------- > > Key: OPENJPA-738 > URL: https://issues.apache.org/jira/browse/OPENJPA-738 > Project: OpenJPA > Issue Type: Improvement > Components: datacache > Affects Versions: 1.2.0, 1.2.1, 1.3.0 > Reporter: Sandhya > Fix For: 1.3.0 > > Attachments: OPENJPA-738.2.patch, OPENJPA-738.3.patch, OPENJPA-738.patch > > > Hi All, > > I have changed the jpa code to eliminate the scan of the jpa query cache to invalidate cached queries that is triggered by entity bean values changes. The problem with the current code is that whenever an entity bean value changes, the query cache needs to be scanned and all the queries that are related to the changed entity bean should be invalidated. This is resulting in poor performance when the querycache has too many queries in it. > > The new approach is to track the timestamp of the query and the timestamp of last update for each entity class and compare the timestamps when retrieving the query for reuse. If the timestamp of the query result is older than the last update time of any entity in the access path of the query, the query result would not be reused and the query result would be evicted from the query cache. > > I introduced a configurable attribute in the persistence.xml in QueryCache property "evictOnTimestamp=true". Therefore the QueryCache property in persistence.xml file looks as follows: > > > > If the "evictOnTimestamp" value is set to true in the xml file the new code is invoked otherwise the old code. The default behaviour would be the old code. That is the value for "evictOnTimestamp" is false by default so that if this property is not set persistence.xml, old code gets invoked. > > In the process of changing the code to evict the queries using the timestamp, I had to introduce 4 methods in QueryCache interface. We want this change to be applied to JPA trunk and 1.2.x branch. Anyone who is extending the QueryCache that implements this interface would have to implement these 4 methods. Please respond as soon as possible if this interface change is an issue. > -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.