openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Glauche (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (OPENJPA-2303) second call of getSingleResult() fails with @EagerFetchMode(FetchMode.JOIN)
Date Mon, 14 Jan 2013 10:54:13 GMT

     [ https://issues.apache.org/jira/browse/OPENJPA-2303?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Michael Glauche updated OPENJPA-2303:
-------------------------------------

    Priority: Critical  (was: Major)
    
> second call of getSingleResult() fails with @EagerFetchMode(FetchMode.JOIN)
> ---------------------------------------------------------------------------
>
>                 Key: OPENJPA-2303
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-2303
>             Project: OpenJPA
>          Issue Type: Bug
>    Affects Versions: 2.2.0, 2.2.1
>            Reporter: Michael Glauche
>            Priority: Critical
>         Attachments: jpaTest.zip
>
>
> When an entity with a field like this:
>  	@OneToMany(mappedBy="parent", fetch=FetchType.EAGER)
> 	@EagerFetchMode(FetchMode.JOIN)
> is loaded with getSingleResult() for the second time, an Exception is thrown:
> javax.persistence.NonUniqueResultException: Query "select A from EntityA A where A.id=1"
selected 3 results, but expected unique result.
> When i remove the @EagerFetchMode annotation everything works fine (but then n+1 selects
are fired to load EntityA)
> See attached Test Project.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message