I'm not sure where to report 2.0.x bugs, and jira.nhibernate.org seems
to be down (linked from www.nhforge.org).
I was having problems with session.SaveOrUpdate on objects with
composite keys where I was getting duplicate object exceptions. After
debugging it, I found that when looking for an existing object in
cache, the wrong object was being retrieved. In my case, I added a
new call doing session.Get<MyType>(myObjOfTypeMyType) and was
retrieving a different object (with different multipart key values
from the object passed). Internally, NHibernate is doing a property
by property comparison of objects in cache to see if a matching object
already exists. The error is in this comparison.
Some contextual code from EntityType.cs (the error is in the IsEqual
method, on line 84 in revision 3741):
object yid;
proxy = y as INHibernateProxy;
if (proxy != null)
{
yid = proxy.HibernateLazyInitializer.Identifier;
}
else
{
----> yid = persister.GetIdentifier(x, entityMode);
// the first
argument here should be y, not x
}
return persister.IdentifierType.IsEqual(xid, yid,
entityMode,
factory);
Like many bugs that cause a serious pain in the backside, the fix is a
single character... of course.
Thanks,
Jacob
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"nhusers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---