Hey,
we encountered a problem that NHibernate ignores setting a 
CollectionTypeFactory without calling AddAssembly method afterwards. 

The following example does not work, constructor of 
Net4CollectionTypeFactory is never called:

configuration = new Configuration(); 
configuration.AddAssembly(typeof(Product).Assembly);  
configuration.Properties[NHibernate.Cfg.Environment.CollectionTypeFactoryClass] 
= typeof(Net4CollectionTypeFactory).AssemblyQualifiedName; 
ISessionFactory sessionFactory = configuration.BuildSessionFactory();

But when calling AddAssembly afterwards everything works fine and 
constructor is called:

configuration = new Configuration(); 
configuration.Properties[NHibernate.Cfg.Environment.CollectionTypeFactoryClass] 
= typeof(Net4CollectionTypeFactory).AssemblyQualifiedName; 
configuration.AddAssembly(typeof(Product).Assembly);   
ISessionFactory sessionFactory = configuration.BuildSessionFactory();

The main problem is when using serialization/deserialization of 
configuration we do not call AddAssembly and thus CollectionTypeFactory is 
ignored.
We observed that after deserialization the property 
CollectionTypeFactoryClass is set but is not used. Calling AddAssembly 
again is not an option in this case
because mappings are already done.

Any ideas?

Best regards,
Rick



-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/nhusers/-/_fpT8GVS18kJ.
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