[hibernate-issues] [Hibernate-JIRA] Commented: (HSEARCH-158) QueryLoader, 'load' fails to load Objects that 'get' can load

Jason Eacott (JIRA) noreply at atlassian.com
Thu Feb 28 17:24:33 EST 2008


    [ http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-158?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_29625 ] 

Jason Eacott commented on HSEARCH-158:
--------------------------------------

actually I'm not sure about this one anymore - I think the problem actually was a combination of things and confused by incorrectly sorted search results. (but the code snippit above is still not ideal - it loops over every hit, regardless of the pagination set and already processed).

> QueryLoader, 'load' fails to load Objects that 'get' can load
> -------------------------------------------------------------
>
>                 Key: HSEARCH-158
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-158
>             Project: Hibernate Search
>          Issue Type: Bug
>         Environment: mysql 5.0.27 (sorry),  linux, windows, hibernate 3.2.5ga
>            Reporter: Jason Eacott
>
> I noticed some odd results so I set up a test:
> from my test (using spring)
> for the same id:
> this works - 1 result as expected.
> SELECT * FROM contents where id='..';
> this fails:
> return   (FeedItem) getHibernateTemplate().load(FeedItem.class, id);
> this works:
> return (FeedItem) getHibernateTemplate().get(FeedItem.class, id);
> why should this forum care?
> because in search.engine.QueryLoader this code fails to load data that clearly exists. I stepped through it and its perfect until the load clause:
> ---------------
> //mandatory to keep the same ordering
> 		List result = new ArrayList(entityInfos.length);
> 		for (EntityInfo entityInfo : entityInfos) {
> 			Object element = session.load( entityInfo.clazz, entityInfo.id );
> 			if ( Hibernate.isInitialized( element ) ) {
> 				//all existing elements should have been loaded by the query,
> 				//the other ones are missing ones
> 				result.add( element );
> 			}
> 		}
> ---------------
> is this a hibernate bug? and/or should hibernatesearch use session.get instead to work around the problem?

-- 
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