From: NHibernate J. <mik...@us...> - 2006-11-28 22:04:31
|
[ http://jira.nhibernate.org/browse/NH-825?page=comments#action_14493 ] Ayende Rahien commented on NH-825: ---------------------------------- This is on SysCache. Specifically, I am talking about SysCache.GetCacheKey(); private string GetCacheKey( object key ) { return String.Concat( _cacheKeyPrefix, _region, ":", key.ToString(), "@", key.GetHashCode() ); } when we are talking about cached queries the key is a QueryKey, and the problem is that the ToString() of the QueryKey doesn't take into account that the entity class may have not overriden the ToString() method. > QueryKey doesn't take into account the entity ID when generating ToString() > --------------------------------------------------------------------------- > > Key: NH-825 > URL: http://jira.nhibernate.org/browse/NH-825 > Project: NHibernate > Type: Bug > Components: Core > Versions: 1.2.0.Beta2 > Reporter: Ayende Rahien > Assignee: Ayende Rahien > Priority: Critical > > The issue is that when a query in the following form is issued: > emp = (Employee.Id = 1} > from Salary s where s.Employee = emp; > And then stored in the cache, the key for it is something like: > select * from Salaries where s.Employee=?;named parameters={emp=Model.Employee} > Thus, not taking into account the entity id, and returning the wrong result back. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.nhibernate.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |