@@ -110,7 +110,7 @@ public void HandleEntityNotFound(string entityName, string propertyName, object
110
110
[ NonSerialized ]
111
111
private readonly IDictionary < string , ICollectionMetadata > collectionMetadata ;
112
112
[ NonSerialized ]
113
- private readonly Dictionary < string , ICollectionPersister > collectionPersisters ;
113
+ private readonly IDictionary < string , ICollectionPersister > collectionPersisters ;
114
114
[ NonSerialized ]
115
115
private readonly ILookup < string , ICollectionPersister > collectionPersistersSpaces ;
116
116
@@ -296,7 +296,7 @@ public SessionFactoryImpl(Configuration cfg, IMapping mapping, Settings settings
296
296
classMetadata = new ReadOnlyDictionary < string , IClassMetadata > ( classMeta ) ;
297
297
298
298
Dictionary < string , ISet < string > > tmpEntityToCollectionRoleMap = new Dictionary < string , ISet < string > > ( ) ;
299
- collectionPersisters = new Dictionary < string , ICollectionPersister > ( ) ;
299
+ var collPersisters = new Dictionary < string , ICollectionPersister > ( ) ;
300
300
foreach ( Mapping . Collection model in cfg . CollectionMappings )
301
301
{
302
302
var cache = GetCacheConcurrencyStrategy (
@@ -306,7 +306,7 @@ public SessionFactoryImpl(Configuration cfg, IMapping mapping, Settings settings
306
306
model . OwnerEntityName ,
307
307
caches ) ;
308
308
var persister = PersisterFactory . CreateCollectionPersister ( model , cache , this ) ;
309
- collectionPersisters [ model . Role ] = persister ;
309
+ collPersisters [ model . Role ] = persister ;
310
310
IType indexType = persister . IndexType ;
311
311
if ( indexType != null && indexType . IsAssociationType && ! indexType . IsAnyType )
312
312
{
@@ -333,6 +333,8 @@ public SessionFactoryImpl(Configuration cfg, IMapping mapping, Settings settings
333
333
}
334
334
}
335
335
336
+ collectionPersisters = new ReadOnlyDictionary < string , ICollectionPersister > ( collPersisters ) ;
337
+
336
338
collectionPersistersSpaces = collectionPersisters
337
339
. SelectMany ( x => x . Value . CollectionSpaces . Select ( y => new { QuerySpace = y , Persister = x . Value } ) )
338
340
. ToLookup ( x => x . QuerySpace , x => x . Persister ) ;
0 commit comments