Breaking changes between build 642 and 644

Asger Hallas's Avatar

Asger Hallas

05 May, 2010 08:12 AM via web

I'm not exactly sure what happened between these two builds, and I have not been able to figure it out from the logs. But mapping my small entity hierarchy is suddenly failing with a
"System.InvalidOperationException: Tried to add many-to-one 'Case' when already added."

I have attached a failing test-case. It works using 642, but every build after that breaks it.

Have something essential changed? Or am I doing something incorrectly?

Cheers,
Asger

And the stack:
at FluentNHibernate.MappingModel.MappedMembers.AddReference(ManyToOneMapping manyToOne) in d:\Builds\FluentNH\src\FluentNHibernate\MappingModel\MappedMembers.cs: line 119
at FluentNHibernate.Automapping.Steps.ReferenceStep.Map(ClassMappingBase classMap, Member property) in d:\Builds\FluentNH\src\FluentNHibernate\Automapping\Steps\ReferenceStep.cs: line 26
at FluentNHibernate.Automapping.AutoMapper.TryMapProperty(ClassMappingBase mapping, Member member, IList1 mappedMembers) in d:\Builds\FluentNH\src\FluentNHibernate\Automapping\AutoMapper.cs: line 121 at FluentNHibernate.Automapping.AutoMapper.<>c__DisplayClassb.<ProcessClass>b__a(Member x) in d:\Builds\FluentNH\src\FluentNHibernate\Automapping\AutoMapper.cs: line 109 at FluentNHibernate.Utils.CollectionExtensions.Each<T>(IEnumerable1 enumerable, Action1 each) in d:\Builds\FluentNH\src\FluentNHibernate\Utils\CollectionExtensions.cs: line 15 at FluentNHibernate.Automapping.AutoMapper.ProcessClass(ClassMappingBase mapping, Type entityType, IList1 mappedMembers) in d:\Builds\FluentNH\src\FluentNHibernate\Automapping\AutoMapper.cs: line 107
at FluentNHibernate.Automapping.AutoPersistenceModel.CompileMappings() in d:\Builds\FluentNH\src\FluentNHibernate\Automapping\AutoPersistenceModel.cs: line 144
at FluentNHibernate.Automapping.AutoPersistenceModel.BuildMappings() in d:\Builds\FluentNH\src\FluentNHibernate\Automapping\AutoPersistenceModel.cs: line 110
at FluentNHibernate.PersistenceModel.EnsureMappingsBuilt() in d:\Builds\FluentNH\src\FluentNHibernate\PersistenceModel.cs: line 193
at FluentNHibernate.PersistenceModel.WriteMappingsTo(Func`2 writerBuilder, Boolean shouldDispose) in d:\Builds\FluentNH\src\FluentNHibernate\PersistenceModel.cs: line 224
at FluentNHibernate.PersistenceModel.WriteMappingsTo(String folder) in d:\Builds\FluentNH\src\FluentNHibernate\PersistenceModel.cs: line 214
at FluentNHibernate.Cfg.AutoMappingsContainer.Apply(Configuration cfg) in d:\Builds\FluentNH\src\FluentNHibernate\Cfg\AutoMappingsContainer.cs: line 79
at FluentNHibernate.Cfg.MappingConfiguration.Apply(Configuration cfg) in d:\Builds\FluentNH\src\FluentNHibernate\Cfg\MappingConfiguration.cs: line 56
at FluentNHibernate.Cfg.FluentConfiguration.BuildConfiguration() in d:\Builds\FluentNH\src\FluentNHibernate\Cfg\FluentConfiguration.cs: line 110

  1. Support Staff 2 Posted by James Gregory on 05 May, 2010 08:18 AM

    James Gregory's Avatar

    I moved around a load of the automapping stuff recently, quite possibly
    between those builds, but I was unaware of any breaking changes. I guess
    there's something we haven't got covered by tests.

    Could you attach your the entity(s) in question, and show us how you're
    setting up the automapper. We'll try to replicate the issue.

  2. 3 Posted by Asger Hallas on 05 May, 2010 08:23 AM

    Asger Hallas's Avatar

    Thanks for quick reply. Entities and setup is in the attached zip-file. It's stripped down to only include the minimum possible to obtain the exception. Do you want it another way? I'll be happy to supply it in any other form too :)

  3. Support Staff 4 Posted by James Gregory on 05 May, 2010 08:31 AM

    James Gregory's Avatar

    Sorry, I missed that you'd already attached it! You're obviously sharper than me in a morning.

    I'll take a look at your issue as soon as possible.

  4. 5 Posted by Asger Hallas on 05 May, 2010 08:35 AM

    Asger Hallas's Avatar

    Well, I guess I had about one hour more than you to wake in, giving I'm at GMT+1 :)

    Thank you!

  5. Support Staff 6 Posted by James Gregory on 06 May, 2010 10:59 PM

    James Gregory's Avatar

    I've just pushed a fix for this up to github. I'd appreciate if you could get the latest version and see if you have any issues with it.

  6. 7 Posted by Asger Hallas on 07 May, 2010 06:33 AM

    Asger Hallas's Avatar

    That's good news! Just checked it out and everything works like a charm.

    Thank you very much. And have a good day :)

  7. Support Staff 8 Posted by James Gregory on 07 May, 2010 07:58 AM

    James Gregory's Avatar

    Great, glad to hear it. Thanks for putting together a decent test for us!

  8. James Gregory closed this discussion on 07 May, 2010 07:58 AM.

Comments are currently closed for this discussion. You can start a new one.