Return-Path: Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: (qmail 48913 invoked from network); 30 Apr 2009 19:33:54 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 30 Apr 2009 19:33:53 -0000 Received: (qmail 83570 invoked by uid 500); 30 Apr 2009 19:33:53 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 83489 invoked by uid 500); 30 Apr 2009 19:33:53 -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 83471 invoked by uid 99); 30 Apr 2009 19:33:53 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 30 Apr 2009 19:33:53 +0000 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; Thu, 30 Apr 2009 19:33:51 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 6B1B2234C003 for ; Thu, 30 Apr 2009 12:33:30 -0700 (PDT) Message-ID: <942931910.1241120010423.JavaMail.jira@brutus> Date: Thu, 30 Apr 2009 12:33:30 -0700 (PDT) From: "Michael Dick (JIRA)" To: dev@openjpa.apache.org Subject: [jira] Assigned: (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-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/OPENJPA-738?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Michael Dick reassigned OPENJPA-738: ------------------------------------ Assignee: Michael Dick > 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 > Assignee: Michael Dick > Fix For: 1.3.0 > > Attachments: OPENJPA-738.10.patch, OPENJPA-738.11.patch, OPENJPA-738.2.patch, OPENJPA-738.3.patch, OPENJPA-738.6.patch, OPENJPA-738.7.patch, OPENJPA-738.8.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.