Related post:
http://forum.hibernate.org/viewtopic.php?t=992593
If an entity class passes a reference to itself through method calls or events (e.g. when implementing INotifyPropertyChanged), for proxied instances, outside callers get a reference to the proxy's inner object. This causes problems when you need to distinguish between instances of the same type and ID (which means you can't use object.Equals), but need to treat the proxy and its inner instance as the same (which means you can't use object.Reference Equals either).
A kludgy workaround is to define a "memory instance ID" property on all your entity classes (or your entity base class) and compare that, because it will be the same for a proxy and its inner reference. However, it would be better to have something like an Unproxy() method on the session, or at least a utility method like AreUnproxiedReferencesEqual().
Does anyone else have this problem? It seems to be a basic consequence of the Decorator design pattern (transparent enclosure) that proxies use (GoF p. 178, "A decorator and its component aren't identical").