Skip to content

OnPreUpdateCollection - Passed entity instance X is not of expected type Y #2508

@marjohansson

Description

@marjohansson

Hi!

When updating from version 5.2.7 to 5.3.2, we get the following error in OnPreUpdateCollection event listener.

Seems to occur when changing a collection in a class (joined subclass) with a lazy property .

Using the lazy property gives us the ProxyForFieldInterceptor and the exception.

at NHibernate.Tuple.Entity.BytecodeEnhancementMetadataPocoImpl.ExtractInterceptor(Object entity)
at NHibernate.Tuple.Entity.BytecodeEnhancementMetadataPocoImpl.HasAnyUninitializedLazyProperties(Object entity)
at NHibernate.Tuple.Entity.AbstractEntityTuplizer.ShouldGetAllProperties(Object entity)
at NHibernate.Tuple.Entity.PocoEntityTuplizer.GetPropertyValues(Object entity)
at NHibernate.Persister.Entity.AbstractEntityPersister.GetPropertyValues(Object obj)
at NHibernate.Test.NHSpecificTest.GH2508.AuditEventListener.OnPreUpdateCollection(PreCollectionUpdateEvent event) in

Thank you for keeping NH alive!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions