I've got a queer bug that I can't find any info on.

Just to be clear, this is NOT a derived class proxy question (at
least, I don't believe it is).

I have two unrelated classes "Certification" and "DuesCategory". Both
inherit from other abstract classes but they are independent of each
other. They are even in separate namespaces.

I'm getting an "NHibernate.PropertyAccessException: Invalid Cast
(check your mapping for property type mismatches); setter of
MyNamespace.Membership.Enrollment ---> System.InvalidCastException:
Unable to cast object of type 'CertificationProxy' to type
'MyNamespace.Membership.DuesCategory'" when I lazy load a DuesCategory
through "Enrollment, which is also lazy loaded.

Basically I'm calling:
Session.Get<SomeClass>(id).Enrollment.DuesCategory

I get a similar exception from the other direction:
"NHibernate.PropertyAccessException: Invalid Cast (check your mapping
for property type mismatches); setter of
MyNamespace.Contacts.PersonCertification --->
System.InvalidCastException: Unable to cast object of type
'DuesCategoryProxy' to type 'MyNamespace.Contacts.Certification'"

In this case Certification is loaded through a lazy loaded collection.

I've reviewed the mappings and classes carefully but I can't see
anything that might be causing this.

Now for the clincher. This only happens after the application has been
running for some amount of time. We haven't discovered the trigger,
but it may be anywhere from minutes to hours before the exception
starts appearing. Resetting the app (by killing the worker process
usually) clears it up and everything is fine again.

Any ideas?

-- 
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.

Reply via email to