I have a multithreaded NHibernate application with ThreadStaticSessionContext. I bind un each thread a new session. Before exiting the thread I commit the transaction and i get
enumerator was modified
at NHibernate.Util.SequencedHashMap.OrderedEnumerator.MoveNext()
at NHibernate.Util.IdentityMap.get_EntryList()
at NHibernate.Util.IdentityMap.ConcurrentEntries(IDictionary map)
at NHibernate.Event.Default.AbstractFlushingEventListener.PrepareEntityFlushes(IEventSource session)
at NHibernate.Event.Default.AbstractFlushingEventListener.FlushEverythingToExecutions(FlushEvent event)
at NHibernate.Event.Default.DefaultFlushEventListener.OnFlush(FlushEvent event)
at NHibernate.Impl.SessionImpl.Flush()
at NHibernate.Transaction.AdoTransaction.Commit()
at ...
I don't have a clue...
This exception is usually thrown when you add/remove from a collection while it is being enumerated (like in a foreach
statement).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With