From: Fabio M. (JIRA) <nh...@gm...> - 2011-05-09 22:27:55
|
[ http://216.121.112.228/browse/NH-2182?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=21025#action_21025 ] Fabio Maulo commented on NH-2182: --------------------------------- Some months, no test. > NHibernate.Event.Default.AbstractFlushingEventListener.AbstractFlushingEventListener() can raise Exception when log is DEBUG > ---------------------------------------------------------------------------------------------------------------------------- > > Key: NH-2182 > URL: http://216.121.112.228/browse/NH-2182 > Project: NHibernate > Issue Type: Bug > Components: Core > Affects Versions: 2.1.2.GA > Reporter: Xavier Le Galles > Priority: Major > > Here is what i get when Log4net is in DEBUG (otherwise there is no exception): > Collection was modified; enumeration operation may not execute. > at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource) > at System.Collections.Generic.Dictionary`2.ValueCollection.Enumerator.MoveNext() > at NHibernate.Impl.Printer.ToString(IEnumerator enumerator, EntityMode entityMode) > 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() > I have checked this method and i found this: > - at the very beginning of the method, you take a reference to IPersistenceContext persistenceContext = session.PersistenceContext > - at the end of the method, if log is in DEBUG: if (log.get_IsDebugEnabled()) > - you try to log the context: new Printer(session.Factory).ToString((IEnumerator) persistenceContext.EntitiesByKey.Values.GetEnumerator(), session.EntityMode); > I have watched the PersistenceContext and yes, it is modified between the beginning and the end of this method: at the beginning, there are 2 entities with no values and at the end 4. Each entity is "doubled" (same ID): one entry has no value, the other one has one. It could be related to the way we calculate the GetHashCode() ... > If you need more details, i could investigate. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://216.121.112.228/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |