[hibernate-issues] [Hibernate-JIRA] Resolved: (HHH-5526) Dirty Entity instances in session after HQL queries with where conditions on OneToMany relation

Gail Badner (JIRA) noreply at atlassian.com
Mon Sep 13 17:51:18 EDT 2010


     [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-5526?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gail Badner resolved HHH-5526.
------------------------------

      Assignee: Gail Badner
    Resolution: Rejected

This is expected behavior.

> Dirty Entity instances in session after HQL queries with where conditions on OneToMany relation
> -----------------------------------------------------------------------------------------------
>
>                 Key: HHH-5526
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5526
>             Project: Hibernate Core
>          Issue Type: Bug
>          Components: core, query-hql
>    Affects Versions: 3.3.2
>         Environment: Hibernate 3.3.2.GA, Java 1.6
>            Reporter: Felix von Delius
>            Assignee: Gail Badner
>
> Having a OneToMany relation on Team.persons, after you execute a HQL query in the form
>     "select distinct t from Team t join fetch t.persons p where p.id = ?"
> the selected Team instance only contains the one person with the id searched for (i.e. missing other persons in this team).
> Probably this could be worked around by changing the query, the main problem ist that this broken Team instance is attached in the session and querying for the team by it's id returns this broken team:
> Team newTeamFetchedById = session.get(Team.class, TEAM_ID); // team id from the query above
> Evicting the fetched team and repeating the query again fetches a team with the correct number of persons.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list