In a SaveOrUpdate call I'm getting the MappingException No persister for: MyClassProxy.
What's strange is that I am able to insert new rows with the code, but if that row exists and the repository tries to update it, I'm getting this exception.
After searching and reading a lot of questions about this exception, that didn't help me to find the reason for this, I'll ask myself: What possible reasons can lead to this exception, if the mapping works for reading / inserting data?
Some more information about my case:
- using NHibernate version 3.3.1.4000
- the mapping is created by code (not fluent) and in another dll that is referenced
- the mapping consists of a
ClassMappingand aSubclassMappingwith a discriminator
I had this same exact issue. Basically I implemented a NHibernate.EmptyInterceptor to support INotifyPropertyChanged notifications.
but the example I used online missed 1 key step... it didn't override the GetEntityName method so proxies would be 'converted' back to the actual objects.
Source answer: Persisting a Castle DynamicProxy that's not associated with a NH Session
Note: the example used "Castle.Proxies" I did not use this and deleted this condition from the if block