You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "Fay Wang (JIRA)" <ji...@apache.org> on 2008/05/04 08:37:55 UTC
[jira] Created: (OPENJPA-590) The push-down sql for JPQL has
unpredictable ordering in the set clause for update statement
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
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.
[jira] Assigned: (OPENJPA-590) The push-down sql for JPQL has
unpredictable ordering in the set clause for update statement
Posted by "Michael Dick (JIRA)" <ji...@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.
[jira] Updated: (OPENJPA-590) The push-down sql for JPQL has
unpredictable ordering in the set clause for update statement
Posted by "Fay Wang (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OPENJPA-590?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Fay Wang updated OPENJPA-590:
-----------------------------
Attachment: openjpa.patch
> 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
> 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.
[jira] Resolved: (OPENJPA-590) The push-down sql for JPQL has
unpredictable ordering in the set clause for update statement
Posted by "Michael Dick (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OPENJPA-590?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Michael Dick resolved OPENJPA-590.
----------------------------------
Resolution: Fixed
Fix Version/s: 1.2.0
> 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
> Fix For: 1.2.0
>
> 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.