Note that there are some explanatory texts on larger screens.

plurals
  1. POError: "Cannot simultaneously fetch multiple bags" when calling Configuration.BuildSessionFactory();
    text
    copied!<p>We are getting this error after upgrading to NHibernate 2.1.</p> <pre><code>[QueryException: Cannot simultaneously fetch multiple bags.] NHibernate.Loader.BasicLoader.PostInstantiate() +418 NHibernate.Loader.Entity.EntityLoader..ctor(IOuterJoinLoadable persister, String[] uniqueKey, IType uniqueKeyType, Int32 batchSize, LockMode lockMode, ISessionFactoryImplementor factory, IDictionary`2 enabledFilters) +123 NHibernate.Loader.Entity.BatchingEntityLoader.CreateBatchingEntityLoader(IOuterJoinLoadable persister, Int32 maxBatchSize, LockMode lockMode, ISessionFactoryImplementor factory, IDictionary`2 enabledFilters) +263 NHibernate.Persister.Entity.AbstractEntityPersister.CreateEntityLoader(LockMode lockMode, IDictionary`2 enabledFilters) +26 NHibernate.Persister.Entity.AbstractEntityPersister.CreateLoaders() +57 NHibernate.Persister.Entity.AbstractEntityPersister.PostInstantiate() +1244 NHibernate.Persister.Entity.SingleTableEntityPersister.PostInstantiate() +18 NHibernate.Impl.SessionFactoryImpl..ctor(Configuration cfg, IMapping mapping, Settings settings, EventListeners listeners) +3261 NHibernate.Cfg.Configuration.BuildSessionFactory() +87 </code></pre> <p>Without stepping into the NHibernate source, it doesn't look like I can see which mapping is creating the issue.</p> <p>It's a very old application with a load of mappings files, lots of mappings have one-to-many bags in them, all lazy instantiated.</p> <p>For example:</p> <pre><code> &lt;bag name="Ownership" lazy="true" cascade="all" inverse="true" outer-join="auto" where="fkOwnershipStatusID!=6"&gt; &lt;key column="fkStakeHolderID"/&gt; &lt;one-to-many class="StakeholderLib.Ownership,StakeholderLib" /&gt; &lt;/bag&gt; </code></pre> <p>maps to:</p> <pre><code>public virtual IList Ownership { get { if (ownership == null) ownership = new ArrayList(); return ownership; } set { ownership = value; } } </code></pre> <p>Has anyone seen this error before when upgrading to NHibernate 2.1?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload