All work

Select view

Select search mode

 
21 of 21

.Cacheable().Fetch() throws 'Exception occurred getter of xxx'

Fixed

Description

This query:
IList<ParentObject> pos = session.Query<ParentObject>().Cacheable().Fetch(po => po.ChildObjects).ToList();

throws this exception:
NHibernate.PropertyAccessException: Exception occurred getter of CacheableFetchTest.Entity`1[[System.Guid, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].Id ---> System.Reflection.TargetException: Object does not match target type..

For a detailed discussion, including full exception stacks, please see:
http://groups.google.com/group/nhusers/browse_thread/thread/dfdbe987d8450b0a/cb812c856e07ee0a

Environment

None

Attachments

1

Details

Assignee

Reporter

Components

Fix versions

Affects versions

Priority

Who's Looking?

Open Who's Looking?
Created September 23, 2010 at 10:50 AM
Updated July 30, 2011 at 2:10 PM
Resolved May 3, 2011 at 4:20 AM

Activity

Show:

Fabio Maulo July 30, 2011 at 2:10 PM

Closed after final release of NH3.2.0GA

Patrick Earl April 11, 2011 at 8:32 PM

The rabbit hole goes deep on this one. It's fundamentally related to complications between result transformers and caching. This is apparently fixed in Hibernate 4.0, but it looks like there would be a substantial amount of work to figure out exactly what and how to port. Because fetching can create duplicate rows, Linq adds a distinct result transformer. I'll think more on this.

Patrick Earl April 11, 2011 at 1:04 PM

Unfortunately I already have a failing test case based on your earlier code. At the moment it's not clear to me what's going on. The result transformer hint on the mailing list is interesting though. I'm naturally happy to have any hints or insights anyone can provide. I can't promise I'll be able to fix this quickly, but I can say that I'll be looking at it as time permits.

Eduardo Segura April 11, 2011 at 12:41 PM

And on my birthday, no less! .

By the way, Patrick, I can code a 'proper' NHibernate test if that would help (and given that this issue has now 21 votes.)

Let me know. I'll be happy to help. And thanks for looking into this.

Luis Fernando April 11, 2011 at 12:22 PM

Great news, it's good to know that the developers listen to the community.
Thank you guys.

Who's Looking?

Flag notifications