Skip to content

ArgumentException on session Flush #2802

Closed
@igorvorona

Description

@igorvorona

I have upgraded existing NHibernate 4.0.4 to 5.3.8. All seem to be working with minor changes, but lots of tests failing with the following error when session is either manually flushed or auto-flushed when executing HQL scripts:

System.ArgumentException : An item with the same key has already been added.
   at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
   at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
   at NHibernate.Collection.Generic.PersistentGenericSet`1.GetSnapshot(ICollectionPersister persister)
   at NHibernate.Engine.CollectionEntry.AfterAction(IPersistentCollection collection)
   at NHibernate.Action.CollectionUpdateAction.Execute()
   at NHibernate.Engine.ActionQueue.InnerExecute(IExecutable executable)
   at NHibernate.Engine.ActionQueue.ExecuteActions[T](List`1 list)
   at NHibernate.Engine.ActionQueue.ExecuteActions()
   at NHibernate.Event.Default.AbstractFlushingEventListener.PerformExecutions(IEventSource session)
   at NHibernate.Event.Default.DefaultAutoFlushEventListener.OnAutoFlush(AutoFlushEvent event)
   at NHibernate.Impl.SessionImpl.AutoFlushIfRequired(ISet`1 querySpaces)
   at NHibernate.Impl.SessionImpl.List(IQueryExpression queryExpression, QueryParameters queryParameters, IList results, Object filterConnection)
   at NHibernate.Impl.SessionImpl.List(IQueryExpression queryExpression, QueryParameters queryParameters, IList results)
   at NHibernate.Impl.AbstractSessionImpl.List(IQueryExpression queryExpression, QueryParameters parameters)
   at NHibernate.Impl.AbstractQueryImpl2.List()

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions