Return-Path: Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: (qmail 4826 invoked from network); 5 May 2008 20:16:17 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 5 May 2008 20:16:17 -0000 Received: (qmail 70775 invoked by uid 500); 5 May 2008 20:16:19 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 70749 invoked by uid 500); 5 May 2008 20:16:19 -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 70738 invoked by uid 99); 5 May 2008 20:16:19 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 May 2008 13:16:19 -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; Mon, 05 May 2008 20:15:41 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 8DEC7234C100 for ; Mon, 5 May 2008 13:15:55 -0700 (PDT) Message-ID: <1717134550.1210018555576.JavaMail.jira@brutus> Date: Mon, 5 May 2008 13:15:55 -0700 (PDT) From: "Michael Dick (JIRA)" To: dev@openjpa.apache.org Subject: [jira] Assigned: (OPENJPA-590) The push-down sql for JPQL has unpredictable ordering in the set clause for update statement In-Reply-To: <1704148758.1209883075679.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-590?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Michael Dick reassigned OPENJPA-590: ------------------------------------ Assignee: Michael Dick > The push-down sql for JPQL has unpredictable ordering in the set clause for update statement > -------------------------------------------------------------------------------------------- > > Key: OPENJPA-590 > URL: https://issues.apache.org/jira/browse/OPENJPA-590 > Project: OpenJPA > Issue Type: Bug > Reporter: Fay Wang > Assignee: Michael Dick > Attachments: openjpa.patch > > > Our application requires the push-down sql from named/dynamic query be the same each time a same JPQL is executed. > In the following JPQL example, however, > > query="UPDATE BasicA t set t.name= ?1, t.age = ?2 WHERE t.id = ?3" > we observe that two different push-down sql could be generated: > > UPDATE PDQBasicA t0 SET name = ?, age = ? WHERE (t0.id = ?) > UPDATE PDQBasicA t0 SET age = ?, name = ? WHERE (t0.id = ?) > This unpredictable behavior breaks our application. The indeterministic ordering of the update list is due to the indeterministic ordering provided by HashMap and HashSet in QueryExpressions and JPQLExpressionBuilder, respectively. > When the HashMap is changed to LinkedHashMap and HashSet to LinkedHashSet, the access order based on insertion will be preserved and the generated push-down sql will have predictable ordering of update list. The attached patch fixes this problem. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.