[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-1718) Have multiple bag fetches revert to subselect fetching for all but one of the bags
Geoffrey De Smet (JIRA)
noreply at atlassian.com
Fri Oct 12 06:10:39 EDT 2007
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1718?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_28413 ]
Geoffrey De Smet commented on HHH-1718:
---------------------------------------
status: "Awaiting testcase", but apparently Sergey wrote one in the duplicate issue linked to this one :)
Sergey Koshcheyev - [01/Mar/07 09:13 AM ]
It seems that not only multiple bag fetches should be disallowed, but any multiple collection fetches which include a bag (with possibly some exceptions). For example, this currently fails for me on H3.2 from SVN (put this into ASTParserLoadingTest.java):
public void testBagSetFetchFails() {
Session s = openSession();
s.beginTransaction();
Human human = new Human();
human.setFriends(new ArrayList());
Human friend1 = new Human();
Human friend2 = new Human();
human.getFriends().add(friend1);
human.getFriends().add(friend2);
friend1.setNickNames(new TreeSet());
friend1.getNickNames().add("nick1");
friend1.getNickNames().add("nick2");
friend2.setNickNames(new TreeSet());
friend1.getNickNames().add("nick21");
friend1.getNickNames().add("nick22");
s.save(human);
s.save(friend1);
s.save(friend2);
s.getTransaction().commit();
s.close();
s = openSession();
human = (Human) s
.createQuery( "from Human h join fetch h.friends f join fetch f.nickNames nof" )
.uniqueResult();
assertTrue(Hibernate.isInitialized(human.getFriends()));
assertEquals(2, human.getFriends().size());
s.getTransaction().commit();
s.close();
}
> Have multiple bag fetches revert to subselect fetching for all but one of the bags
> ----------------------------------------------------------------------------------
>
> Key: HHH-1718
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1718
> Project: Hibernate3
> Issue Type: Improvement
> Components: core, query-criteria, query-hql
> Reporter: Steve Ebersole
> Assignee: Steve Ebersole
> Fix For: hql+collection
>
> Attachments: hibernate_eksempel.zip
>
>
> Follow on to HHH-1413. Multiple bag fetches were simply disallowed as the resolution to that particular case in the interest of working around that issue.
> The correct longer term solution is to not fetch all the bags at once, ideally reverting to subselect fetching for all but one of the bags.
--
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