Return-Path: Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: (qmail 57289 invoked from network); 11 Nov 2009 21:31:15 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 11 Nov 2009 21:31:15 -0000 Received: (qmail 6052 invoked by uid 500); 11 Nov 2009 21:31:15 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 6018 invoked by uid 500); 11 Nov 2009 21:31:15 -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 6008 invoked by uid 99); 11 Nov 2009 21:31:15 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 Nov 2009 21:31:15 +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; Wed, 11 Nov 2009 21:31:12 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 7B81B234C4AD for ; Wed, 11 Nov 2009 13:30:51 -0800 (PST) Message-ID: <297198639.1257975051504.JavaMail.jira@brutus> Date: Wed, 11 Nov 2009 21:30:51 +0000 (UTC) From: "Fay Wang (JIRA)" To: dev@openjpa.apache.org Subject: [jira] Closed: (OPENJPA-1380) Query not getting evicted from QueryCache In-Reply-To: <522609480.1257900927955.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-1380?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Fay Wang closed OPENJPA-1380. ----------------------------- > Query not getting evicted from QueryCache > ----------------------------------------- > > Key: OPENJPA-1380 > URL: https://issues.apache.org/jira/browse/OPENJPA-1380 > Project: OpenJPA > Issue Type: Bug > Affects Versions: 1.2.1, 2.0.0 > Reporter: Catalina Wei > Assignee: Fay Wang > Fix For: 2.0.0 > > > I'm running on OpenJPA 1.2.1 > The following query is added to the QueryCache: > Query: org.apache.openjpa.kernel.QueryImpl@3afe3afe; > candidate class: class com.ibm.usmi.datamodel.system.OperatingSystem; > query: SELECT distinct > OPERATINGSYSTEM1.OID,OPERATINGSYSTEM1.Guid,OPERATINGSYSTEM1.ObjectType,OPERATINGSYSTEM1.Name,REMOTESERVICEACCESSPOINT1.OID,REMOTESERVICEACCESSPOINT1.Guid,REMOTESERVICEACCESSPOINT1.ObjectType,REMOTESERVICEACCESSPOINT1.Name > FROM OperatingSystem > OPERATINGSYSTEM1,System_accessedVia_RemoteServiceAccessPoint > SYSTEM_ACCESSEDVIA_REMOTESERVICEACCESSPOINT1,RemoteServiceAccessPoint > REMOTESERVICEACCESSPOINT1,RelationshipInfo RELATIONSHIPINFO1 WHERE > OPERATINGSYSTEM1.OID = SYSTEM_ACCESSEDVIA_REMOTESERVICEACCESSPOINT1.sourceId > AND REMOTESERVICEACCESSPOINT1.OID = > SYSTEM_ACCESSEDVIA_REMOTESERVICEACCESSPOINT1.targetId AND > (OPERATINGSYSTEM1.Guid = ?1) AND (OPERATINGSYSTEM1.OID = ?2) AND > ((OPERATINGSYSTEM1.BuildNumber = ?3)) AND (REMOTESERVICEACCESSPOINT1.Guid = > ?4) AND (REMOTESERVICEACCESSPOINT1.OID = ?5) AND > ((REMOTESERVICEACCESSPOINT1.Port = ?6)) AND RELATIONSHIPINFO1.changedDate > > ?7 and RELATIONSHIPINFO1.sourceOID=OPERATINGSYSTEM1.OID and > RELATIONSHIPINFO1.relationshipType = ?8 and > RELATIONSHIPINFO1.targetOID=REMOTESERVICEACCESSPOINT1.OID > Later on, a record in RelationshipInfo is changed, which changes what should > be returned from this query. I'd expect this to cause the cached query to > get evicted from the QueryCache, but it is not. If I get the > QueryResultCache, and evictAll RelationshipInfo.class, it still doesn't get > removed. This seems to be because the AccessPath only contains > OperatingSystem. I'd expect this to contain all entities that this query > deals with: > {OperatingSystem, > System_accessedVia_RemoteServiceAccessPoint, RemoteServiceAccessPoint, > RelationshipInfo} > But the AccessPath only seems to contain the entity of what is returned from > the query. > What do I need to do so this query gets evicted like I'd expect. > This problem can be easily reproduced by the following query: > String jpql = "select p.name, c.name from OneOneParent p, OneOneChild c where " + > "p.id = c.id and c.name = ?1"; > The query cache key is: > "org.apache.openjpa.datacache.QueryKey@d11db9a4 > [ > query:[select p.name, c.name from OneOneParent p, OneOneChild c where p.id = c.id and c.name = ?1], > access path:[queryCache.OneOneParent], > subs:true, > ignoreChanges:false, > startRange:0, > endRange:9223372036854775807,timeout:-1 > ]". > This problem can be resolved if access path in QueryKey also contains queryCache.OneOneChild. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.