Return-Path: X-Original-To: apmail-openjpa-dev-archive@www.apache.org Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id AE3BBDCF4 for ; Thu, 12 Jul 2012 17:58:37 +0000 (UTC) Received: (qmail 56823 invoked by uid 500); 12 Jul 2012 17:58:36 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 56660 invoked by uid 500); 12 Jul 2012 17:58:36 -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 56593 invoked by uid 99); 12 Jul 2012 17:58:36 -0000 Received: from issues-vm.apache.org (HELO issues-vm) (140.211.11.160) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 Jul 2012 17:58:36 +0000 Received: from isssues-vm.apache.org (localhost [127.0.0.1]) by issues-vm (Postfix) with ESMTP id D966E142860 for ; Thu, 12 Jul 2012 17:58:35 +0000 (UTC) Date: Thu, 12 Jul 2012 17:58:35 +0000 (UTC) From: "Helen Xu (JIRA)" To: dev@openjpa.apache.org Message-ID: <1449564910.42915.1342115915892.JavaMail.jiratomcat@issues-vm> In-Reply-To: <676833292.30281.1341946234779.JavaMail.jiratomcat@issues-vm> Subject: [jira] [Assigned] (OPENJPA-2228) QuerySQLCache broken for Entities with @EmbeddedId MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/OPENJPA-2228?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Helen Xu reassigned OPENJPA-2228: --------------------------------- Assignee: Helen Xu > QuerySQLCache broken for Entities with @EmbeddedId > -------------------------------------------------- > > Key: OPENJPA-2228 > URL: https://issues.apache.org/jira/browse/OPENJPA-2228 > Project: OpenJPA > Issue Type: Bug > Components: query > Affects Versions: 2.2.0 > Reporter: Michael Glauche > Assignee: Helen Xu > Attachments: openjpaBugreport.zip > > > Multiple calls of a query which has some Relationships with @EmbeddedId fields fails if QuerySQLCache is enabled. > q = em.createQuery("select l from ListTest l where l.te=:test"); > does create: > SELECT t0.id, t0.keyA, t0.keyB, t0.keyC, t1.keyA, t1.keyB, t1.keyC, t1.data1, > t1.data2 > FROM ListTest t0 LEFT OUTER JOIN TestEntity t1 ON t0.keyA = t1.keyA AND t0.keyB > = t1.keyB AND t0.keyC = t1.keyC > WHERE (t0.keyA = ? AND t0.keyB = ? AND t0.keyC = ?) > [params=(int) 1, (int) 2, (int) 3] > however a second query will create: > q = em.createQuery("select l from ListTest l where l.te=:test"); > SELECT t0.id, t0.keyA, t0.keyB, t0.keyC, t1.keyA, t1.keyB, t1.keyC, t1.data1, > t1.data2 > FROM ListTest t0 LEFT OUTER JOIN TestEntity t1 ON t0.keyA = t1.keyA AND t0.keyB > = t1.keyB AND t0.keyC = t1.keyC > WHERE (t0.keyA = ? AND t0.keyB = ? AND t0.keyC = ?) > [params=(int) 3, (int) 2, (int) 3] > Note the wrong first param ! > (There is some Index filed calculated somewhere in the query and the index Array has [0,0,0] as values, so the 0th position does get updated three times .. the bug should be something with the index i think) > See attached test-project -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira