[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-5992) A query fails to return correct results silently

Strong Liu (JIRA) noreply at atlassian.com
Fri Aug 19 21:19:02 EDT 2011


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-5992?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43306#comment-43306 ] 

Strong Liu commented on HHH-5992:
---------------------------------

https://issues.jboss.org/browse/JBPAPP-6759

> A query fails to return correct results silently
> ------------------------------------------------
>
>                 Key: HHH-5992
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5992
>             Project: Hibernate Core
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 3.3.2
>         Environment: JBoss EAP 5.1
>            Reporter: Tom Ross
>            Assignee: Strong Liu
>         Attachments: TestCaseBug-HHH-5992.zip
>
>
> The following query fails silently to return a correct result select v1.username, v2.username from user_ety v1, user_ety v2 where v1.username = '1' and v2.username = '2'. It returns one row with "1,1" instead of one row with "1,2".
> The query works with pre JPA CMP EJBs (ver 2.1) but fails when moved to JPA based persistence.
> This failure is very dangerous since it is silent and without manually checking data it is impossible to determine if a correct set is returned.
> The workaround is to use aliases and modify the query so it looks like that:
> select v1.username as username1, v2.username as username2 from user_ety v1, user_ety v2 where v1.username = '1' and v2.username = '2'.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list