From: Boyan T. (JIRA) <nh...@gm...> - 2011-05-19 08:56:51
|
Inconsistent behavior of one-to-one relation through PK with lazy="no-proxy" ----------------------------------------------------------------------------- Key: NH-2716 URL: http://216.121.112.228/browse/NH-2716 Project: NHibernate Issue Type: Bug Components: Core Affects Versions: 3.2.0Beta1 Reporter: Boyan Trushev This is a follow-up of the problem I described in #NH-2704. While I was debugging the issue there I found another problem that concerns the case when the one-to-one relation is though PK and lazy is set to "no-proxy". The issue can be easily reproduced with the existing LazyOneToOne test case. You just have to duplicate the assert that checks if p2.Employee is null: p2 = s.CreateQuery("from Person where name='Emmanuel'").UniqueResult<Person>(); Assert.That(p2.Employee, Is.Null); Assert.That(p2.Employee, Is.Null); If you run the Lazy() test case now you will see that it fails on the second assert. On the first "Assert" the Employee property returns null as it is still not loaded (not contained in loadedUnwrapProxyFieldNames) and the EmployeeProxy which is contained in the field is unwrapped. After the first access however the fieldName is added to loadedUnwrapProxyFieldNames and on the next property access the EmployeeProxy is no more unwrapped. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://216.121.112.228/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |