From dev-return-9381-apmail-openjpa-dev-archive=openjpa.apache.org@openjpa.apache.org Tue Oct 21 17:06:05 2008 Return-Path: Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: (qmail 92525 invoked from network); 21 Oct 2008 17:06:05 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 21 Oct 2008 17:06:05 -0000 Received: (qmail 28408 invoked by uid 500); 21 Oct 2008 17:06:07 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 28364 invoked by uid 500); 21 Oct 2008 17:06:07 -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 28337 invoked by uid 99); 21 Oct 2008 17:06:07 -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 10:06:07 -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 17:05:05 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 3F449234C228 for ; Tue, 21 Oct 2008 10:05:44 -0700 (PDT) Message-ID: <1816253660.1224608744244.JavaMail.jira@brutus> Date: Tue, 21 Oct 2008 10:05:44 -0700 (PDT) From: "Catalina Wei (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=12641437#action_12641437 ] Catalina Wei commented on OPENJPA-738: -------------------------------------- OPENJPA-738.6.patch does not have any interface changes, and the configurable property for query eviction policy is a String value so it is more extendable. > 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.6.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.